@@ -530,3 +530,82 @@ async def test_column_position_change_up(test_app: KanbanTui):
530530 ).highlighted_child .column .position
531531 == 1
532532 )
533+
534+
535+ # Part 1 test for https://github.com/Zaloog/kanban-tui/issues/58
536+ async def test_column_position_change_updates_status_values (test_app : KanbanTui ):
537+ async with test_app .run_test (size = APP_SIZE ) as pilot :
538+ await pilot .press ("ctrl+l" )
539+
540+ await pilot .press ("ctrl+o" )
541+ await pilot .press ("c" )
542+ assert pilot .app .screen .query_exactly_one (ColumnSelector ).has_focus_within
543+
544+ # Go to Doing Item
545+ await pilot .press (* "jj" )
546+
547+ # Move Doing Column from position 2 -> 1
548+ await pilot .press ("K" )
549+
550+ # get Dropdown value at position 1, which should be "Doing at this point"
551+ assert (
552+ (
553+ pilot .app .screen .query_exactly_one (StatusColumnSelector )
554+ .query_one ("#select_reset" , Select )
555+ ._options [1 ][0 ]
556+ ._text [0 ]
557+ )
558+ == "Doing"
559+ )
560+
561+
562+ # Part 2 test for https://github.com/Zaloog/kanban-tui/issues/58
563+ async def test_column_selector_updates_on_board_change (test_app : KanbanTui ):
564+ async with test_app .run_test (size = APP_SIZE ) as pilot :
565+ # Go to Setting Screen to initially load the widgets
566+ await pilot .press ("ctrl+l" )
567+
568+ # go back to BoardScreen and create a new board
569+ await pilot .press ("ctrl+j" )
570+ await pilot .press ("B" )
571+
572+ # Open Board Creation Screen
573+ await pilot .press ("n" )
574+
575+ # Enter new Icon
576+ await pilot .press (* "bug" )
577+
578+ # Enter new board name
579+ await pilot .click ("#input_board_name" )
580+ await pilot .press (* "Test Board" )
581+
582+ # Add Custom Columns
583+ # CustomList visible after switch press
584+ await pilot .click ("#switch_use_default_columns" )
585+
586+ # Focus input
587+ await pilot .press ("tab" )
588+ await pilot .press (* "test_column" )
589+ # next column input
590+ await pilot .press ("tab" , "tab" )
591+ await pilot .press (* "test_column2" )
592+ # delete last column input
593+ await pilot .press ("shift+tab" , "shift+tab" , "delete" )
594+
595+ # save board
596+ await pilot .click ("#btn_continue_new_board" )
597+ # Click to activate new Board
598+ await pilot .press ("j" , "enter" )
599+
600+ # Move to Setting Screen
601+ await pilot .press ("ctrl+l" )
602+ await pilot .press ("ctrl+o" )
603+ await pilot .press ("c" )
604+ assert pilot .app .screen .query_exactly_one (ColumnSelector ).has_focus_within
605+
606+ # Go to test_column2
607+ await pilot .press ("j" )
608+ assert pilot .app .focused .highlighted_child .column .name == "test_column2"
609+
610+ # Columns in View also updates
611+ assert pilot .app .screen .query_one ("#select_columns_in_view" ).value == 1
0 commit comments