test(history): clean up sidebar test contexts
- commit
- d0951c471a10c0b1cf7d7d12d7058c14c4df4bf3
- author
- brice · · 2026-06-13 07:22 UTC
- parent
- 5caec5d
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
4 files · +29 -35
M internal/ui/browser_window_test.go +14 -14
| @@ -911,7 +911,7 @@ func TestRestoreSession_ActiveWindowIndexSyncsState(t *testing.T) { | |||
| 911 | 911 | // that the default OnNavigate callback targets the owning browser window's | |
| 912 | 912 | // active pane and keeps the sidebar visible. | |
| 913 | 913 | func TestHistorySidebarConfig_OnNavigateNavigatesActivePaneAndKeepsSidebar(t *testing.T) { | |
| 914 | - | ctx := context.Background() | |
| 914 | + | ctx := t.Context() | |
| 915 | 915 | ||
| 916 | 916 | // Build two browser windows with independent tabs and panes. | |
| 917 | 917 | tab1 := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | |
| @@ -973,7 +973,7 @@ func TestHistorySidebarConfig_OnNavigateNavigatesActivePaneAndKeepsSidebar(t *te | |||
| 973 | 973 | // that the OnNavigateKeepOpen callback (Ctrl+Enter) navigates the owning window's | |
| 974 | 974 | // active pane and keeps the sidebar visible. | |
| 975 | 975 | func TestHistorySidebarConfig_OnNavigateKeepOpenNavigatesWithoutClosing(t *testing.T) { | |
| 976 | - | ctx := context.Background() | |
| 976 | + | ctx := t.Context() | |
| 977 | 977 | ||
| 978 | 978 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | |
| 979 | 979 | bwTabs := entity.NewTabList() | |
| @@ -1011,7 +1011,7 @@ func TestHistorySidebarConfig_OnNavigateKeepOpenNavigatesWithoutClosing(t *testi | |||
| 1011 | 1011 | // correct owning window's active pane. This tests the stale-focus scenario | |
| 1012 | 1012 | // where a different window is globally focused. | |
| 1013 | 1013 | func TestHistorySidebar_OwnershipOnMultiWindowNavigation(t *testing.T) { | |
| 1014 | - | ctx := context.Background() | |
| 1014 | + | ctx := t.Context() | |
| 1015 | 1015 | ||
| 1016 | 1016 | // Two windows, each with their own tab and pane. | |
| 1017 | 1017 | tab1 := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | |
| @@ -1225,7 +1225,7 @@ func TestApp_HistorySidebarToggleHandler_NilFocusedWindowIsNoOp(t *testing.T) { | |||
| 1225 | 1225 | // TestHistorySidebarConfig_OnCloseHidesSidebar verifies that the OnClose | |
| 1226 | 1226 | // callback hides the sidebar for the owning browser window. | |
| 1227 | 1227 | func TestHistorySidebarConfig_OnCloseHidesSidebar(t *testing.T) { | |
| 1228 | - | ctx := context.Background() | |
| 1228 | + | ctx := t.Context() | |
| 1229 | 1229 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | |
| 1230 | 1230 | bwTabs := entity.NewTabList() | |
| 1231 | 1231 | bwTabs.Add(tab) | |
| @@ -1261,7 +1261,7 @@ func TestHistorySidebarConfig_OnCloseHidesSidebar(t *testing.T) { | |||
| 1261 | 1261 | // dispatches ActionToggleHistorySystemView, asserting the focused browser | |
| 1262 | 1262 | // window's sidebar visibility toggles. | |
| 1263 | 1263 | func TestApp_HistorySidebar_ToggleThroughKeyboardDispatcher(t *testing.T) { | |
| 1264 | - | ctx := context.Background() | |
| 1264 | + | ctx := t.Context() | |
| 1265 | 1265 | ||
| 1266 | 1266 | focusedBW := &browserWindow{ | |
| 1267 | 1267 | id: "focused", | |
| @@ -1309,7 +1309,7 @@ func TestApp_HistorySidebar_ToggleThroughKeyboardDispatcher(t *testing.T) { | |||
| 1309 | 1309 | // TestApp_HistorySidebar_ToggleThroughDispatcher_UnavailableReturnsError verifies that | |
| 1310 | 1310 | // when the focused window has no history sidebar, Ctrl+H returns a clean error. | |
| 1311 | 1311 | func TestApp_HistorySidebar_ToggleThroughDispatcher_UnavailableReturnsError(t *testing.T) { | |
| 1312 | - | ctx := context.Background() | |
| 1312 | + | ctx := t.Context() | |
| 1313 | 1313 | ||
| 1314 | 1314 | bw := &browserWindow{ | |
| 1315 | 1315 | id: "no-sidebar", | |
| @@ -1342,7 +1342,7 @@ func TestApp_HistorySidebar_ToggleThroughDispatcher_UnavailableReturnsError(t *t | |||
| 1342 | 1342 | // TestApp_HistorySidebar_ToggleThroughDispatcher_NilFocusedReturnsError verifies | |
| 1343 | 1343 | // that the toggle handler returns a clean error when there is no focused window. | |
| 1344 | 1344 | func TestApp_HistorySidebar_ToggleThroughDispatcher_NilFocusedReturnsError(t *testing.T) { | |
| 1345 | - | ctx := context.Background() | |
| 1345 | + | ctx := t.Context() | |
| 1346 | 1346 | ||
| 1347 | 1347 | app := &App{ | |
| 1348 | 1348 | browserWindows: make(map[string]*browserWindow), | |
| @@ -1373,7 +1373,7 @@ func TestApp_HistorySidebar_ToggleThroughDispatcher_NilFocusedReturnsError(t *te | |||
| 1373 | 1373 | // callback from buildHistorySidebarConfig navigates the owning browser window's | |
| 1374 | 1374 | // active pane to the given URL. | |
| 1375 | 1375 | func TestApp_HistorySidebarConfig_NavigateCallbackNavigates(t *testing.T) { | |
| 1376 | - | ctx := context.Background() | |
| 1376 | + | ctx := t.Context() | |
| 1377 | 1377 | ||
| 1378 | 1378 | paneID := entity.PaneID("pane-1") | |
| 1379 | 1379 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | |
| @@ -1421,7 +1421,7 @@ func TestApp_HistorySidebarConfig_NavigateCallbackNavigates(t *testing.T) { | |||
| 1421 | 1421 | } | |
| 1422 | 1422 | ||
| 1423 | 1423 | func TestApp_NavigateHistorySidebarSelection_KeepsSidebarVisible(t *testing.T) { | |
| 1424 | - | ctx := context.Background() | |
| 1424 | + | ctx := t.Context() | |
| 1425 | 1425 | ||
| 1426 | 1426 | paneID := entity.PaneID("pane-1") | |
| 1427 | 1427 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | |
| @@ -1464,7 +1464,7 @@ func TestApp_NavigateHistorySidebarSelection_KeepsSidebarVisible(t *testing.T) { | |||
| 1464 | 1464 | // OnNavigate targets the callback's owning window, not the globally focused | |
| 1465 | 1465 | // window, when they differ. | |
| 1466 | 1466 | func TestApp_HistorySidebarConfig_NavigateCallbackOwnership(t *testing.T) { | |
| 1467 | - | ctx := context.Background() | |
| 1467 | + | ctx := t.Context() | |
| 1468 | 1468 | ||
| 1469 | 1469 | tab1 := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | |
| 1470 | 1470 | tab2 := entity.NewTab(entity.TabID("tab-2"), entity.WorkspaceID("ws-2"), entity.NewPane(entity.PaneID("pane-2"))) | |
| @@ -1519,7 +1519,7 @@ func TestApp_HistorySidebarConfig_NavigateCallbackOwnership(t *testing.T) { | |||
| 1519 | 1519 | // TestApp_HistorySidebarConfig_KeepOpenCallback verifies that | |
| 1520 | 1520 | // OnNavigateKeepOpen navigates the owning window without hiding the sidebar. | |
| 1521 | 1521 | func TestApp_HistorySidebarConfig_KeepOpenCallback(t *testing.T) { | |
| 1522 | - | ctx := context.Background() | |
| 1522 | + | ctx := t.Context() | |
| 1523 | 1523 | ||
| 1524 | 1524 | paneID := entity.PaneID("pane-1") | |
| 1525 | 1525 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | |
| @@ -1569,7 +1569,7 @@ func TestApp_HistorySidebarConfig_KeepOpenCallback(t *testing.T) { | |||
| 1569 | 1569 | // OnOpenInNewPane activates the owning browser window and creates a split | |
| 1570 | 1570 | // with the target URL. | |
| 1571 | 1571 | func TestApp_HistorySidebarConfig_OpenInNewPaneCallback(t *testing.T) { | |
| 1572 | - | ctx := context.Background() | |
| 1572 | + | ctx := t.Context() | |
| 1573 | 1573 | ||
| 1574 | 1574 | paneID := entity.PaneID("pane-1") | |
| 1575 | 1575 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | |
| @@ -1627,7 +1627,7 @@ func TestApp_HistorySidebarConfig_OpenInNewPaneCallback(t *testing.T) { | |||
| 1627 | 1627 | // TestApp_HistorySidebarConfig_CloseCallback verifies that OnClose hides the | |
| 1628 | 1628 | // sidebar for the owning browser window and restores focus to the active pane. | |
| 1629 | 1629 | func TestApp_HistorySidebarConfig_CloseCallback(t *testing.T) { | |
| 1630 | - | ctx := context.Background() | |
| 1630 | + | ctx := t.Context() | |
| 1631 | 1631 | ||
| 1632 | 1632 | paneID := entity.PaneID("pane-1") | |
| 1633 | 1633 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | |
| @@ -1674,7 +1674,7 @@ func TestApp_HistorySidebarConfig_CloseCallback(t *testing.T) { | |||
| 1674 | 1674 | // OnClose (hideAndRestoreFocusForBrowserWindow) is safe when the browser | |
| 1675 | 1675 | // window has no sidebar or is nil. | |
| 1676 | 1676 | func TestApp_HistorySidebarConfig_CloseWithNoSidebarIsSafe(t *testing.T) { | |
| 1677 | - | ctx := context.Background() | |
| 1677 | + | ctx := t.Context() | |
| 1678 | 1678 | ||
| 1679 | 1679 | bw := &browserWindow{ | |
| 1680 | 1680 | id: "no-sidebar", | |
| @@ -911,7 +911,7 @@ func TestRestoreSession_ActiveWindowIndexSyncsState(t *testing.T) { | |||||
| 911 | // that the default OnNavigate callback targets the owning browser window's | 911 | // that the default OnNavigate callback targets the owning browser window's | ||
| 912 | // active pane and keeps the sidebar visible. | 912 | // active pane and keeps the sidebar visible. | ||
| 913 | func TestHistorySidebarConfig_OnNavigateNavigatesActivePaneAndKeepsSidebar(t *testing.T) { | 913 | func TestHistorySidebarConfig_OnNavigateNavigatesActivePaneAndKeepsSidebar(t *testing.T) { | ||
| 914 | - | ctx := context.Background() | 914 | + | ctx := t.Context() |
| 915 | 915 | ||||
| 916 | // Build two browser windows with independent tabs and panes. | 916 | // Build two browser windows with independent tabs and panes. | ||
| 917 | tab1 := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | 917 | tab1 := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | ||
| @@ -973,7 +973,7 @@ func TestHistorySidebarConfig_OnNavigateNavigatesActivePaneAndKeepsSidebar(t *te | |||||
| 973 | // that the OnNavigateKeepOpen callback (Ctrl+Enter) navigates the owning window's | 973 | // that the OnNavigateKeepOpen callback (Ctrl+Enter) navigates the owning window's | ||
| 974 | // active pane and keeps the sidebar visible. | 974 | // active pane and keeps the sidebar visible. | ||
| 975 | func TestHistorySidebarConfig_OnNavigateKeepOpenNavigatesWithoutClosing(t *testing.T) { | 975 | func TestHistorySidebarConfig_OnNavigateKeepOpenNavigatesWithoutClosing(t *testing.T) { | ||
| 976 | - | ctx := context.Background() | 976 | + | ctx := t.Context() |
| 977 | 977 | ||||
| 978 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | 978 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | ||
| 979 | bwTabs := entity.NewTabList() | 979 | bwTabs := entity.NewTabList() | ||
| @@ -1011,7 +1011,7 @@ func TestHistorySidebarConfig_OnNavigateKeepOpenNavigatesWithoutClosing(t *testi | |||||
| 1011 | // correct owning window's active pane. This tests the stale-focus scenario | 1011 | // correct owning window's active pane. This tests the stale-focus scenario | ||
| 1012 | // where a different window is globally focused. | 1012 | // where a different window is globally focused. | ||
| 1013 | func TestHistorySidebar_OwnershipOnMultiWindowNavigation(t *testing.T) { | 1013 | func TestHistorySidebar_OwnershipOnMultiWindowNavigation(t *testing.T) { | ||
| 1014 | - | ctx := context.Background() | 1014 | + | ctx := t.Context() |
| 1015 | 1015 | ||||
| 1016 | // Two windows, each with their own tab and pane. | 1016 | // Two windows, each with their own tab and pane. | ||
| 1017 | tab1 := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | 1017 | tab1 := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | ||
| @@ -1225,7 +1225,7 @@ func TestApp_HistorySidebarToggleHandler_NilFocusedWindowIsNoOp(t *testing.T) { | |||||
| 1225 | // TestHistorySidebarConfig_OnCloseHidesSidebar verifies that the OnClose | 1225 | // TestHistorySidebarConfig_OnCloseHidesSidebar verifies that the OnClose | ||
| 1226 | // callback hides the sidebar for the owning browser window. | 1226 | // callback hides the sidebar for the owning browser window. | ||
| 1227 | func TestHistorySidebarConfig_OnCloseHidesSidebar(t *testing.T) { | 1227 | func TestHistorySidebarConfig_OnCloseHidesSidebar(t *testing.T) { | ||
| 1228 | - | ctx := context.Background() | 1228 | + | ctx := t.Context() |
| 1229 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | 1229 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | ||
| 1230 | bwTabs := entity.NewTabList() | 1230 | bwTabs := entity.NewTabList() | ||
| 1231 | bwTabs.Add(tab) | 1231 | bwTabs.Add(tab) | ||
| @@ -1261,7 +1261,7 @@ func TestHistorySidebarConfig_OnCloseHidesSidebar(t *testing.T) { | |||||
| 1261 | // dispatches ActionToggleHistorySystemView, asserting the focused browser | 1261 | // dispatches ActionToggleHistorySystemView, asserting the focused browser | ||
| 1262 | // window's sidebar visibility toggles. | 1262 | // window's sidebar visibility toggles. | ||
| 1263 | func TestApp_HistorySidebar_ToggleThroughKeyboardDispatcher(t *testing.T) { | 1263 | func TestApp_HistorySidebar_ToggleThroughKeyboardDispatcher(t *testing.T) { | ||
| 1264 | - | ctx := context.Background() | 1264 | + | ctx := t.Context() |
| 1265 | 1265 | ||||
| 1266 | focusedBW := &browserWindow{ | 1266 | focusedBW := &browserWindow{ | ||
| 1267 | id: "focused", | 1267 | id: "focused", | ||
| @@ -1309,7 +1309,7 @@ func TestApp_HistorySidebar_ToggleThroughKeyboardDispatcher(t *testing.T) { | |||||
| 1309 | // TestApp_HistorySidebar_ToggleThroughDispatcher_UnavailableReturnsError verifies that | 1309 | // TestApp_HistorySidebar_ToggleThroughDispatcher_UnavailableReturnsError verifies that | ||
| 1310 | // when the focused window has no history sidebar, Ctrl+H returns a clean error. | 1310 | // when the focused window has no history sidebar, Ctrl+H returns a clean error. | ||
| 1311 | func TestApp_HistorySidebar_ToggleThroughDispatcher_UnavailableReturnsError(t *testing.T) { | 1311 | func TestApp_HistorySidebar_ToggleThroughDispatcher_UnavailableReturnsError(t *testing.T) { | ||
| 1312 | - | ctx := context.Background() | 1312 | + | ctx := t.Context() |
| 1313 | 1313 | ||||
| 1314 | bw := &browserWindow{ | 1314 | bw := &browserWindow{ | ||
| 1315 | id: "no-sidebar", | 1315 | id: "no-sidebar", | ||
| @@ -1342,7 +1342,7 @@ func TestApp_HistorySidebar_ToggleThroughDispatcher_UnavailableReturnsError(t *t | |||||
| 1342 | // TestApp_HistorySidebar_ToggleThroughDispatcher_NilFocusedReturnsError verifies | 1342 | // TestApp_HistorySidebar_ToggleThroughDispatcher_NilFocusedReturnsError verifies | ||
| 1343 | // that the toggle handler returns a clean error when there is no focused window. | 1343 | // that the toggle handler returns a clean error when there is no focused window. | ||
| 1344 | func TestApp_HistorySidebar_ToggleThroughDispatcher_NilFocusedReturnsError(t *testing.T) { | 1344 | func TestApp_HistorySidebar_ToggleThroughDispatcher_NilFocusedReturnsError(t *testing.T) { | ||
| 1345 | - | ctx := context.Background() | 1345 | + | ctx := t.Context() |
| 1346 | 1346 | ||||
| 1347 | app := &App{ | 1347 | app := &App{ | ||
| 1348 | browserWindows: make(map[string]*browserWindow), | 1348 | browserWindows: make(map[string]*browserWindow), | ||
| @@ -1373,7 +1373,7 @@ func TestApp_HistorySidebar_ToggleThroughDispatcher_NilFocusedReturnsError(t *te | |||||
| 1373 | // callback from buildHistorySidebarConfig navigates the owning browser window's | 1373 | // callback from buildHistorySidebarConfig navigates the owning browser window's | ||
| 1374 | // active pane to the given URL. | 1374 | // active pane to the given URL. | ||
| 1375 | func TestApp_HistorySidebarConfig_NavigateCallbackNavigates(t *testing.T) { | 1375 | func TestApp_HistorySidebarConfig_NavigateCallbackNavigates(t *testing.T) { | ||
| 1376 | - | ctx := context.Background() | 1376 | + | ctx := t.Context() |
| 1377 | 1377 | ||||
| 1378 | paneID := entity.PaneID("pane-1") | 1378 | paneID := entity.PaneID("pane-1") | ||
| 1379 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | 1379 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | ||
| @@ -1421,7 +1421,7 @@ func TestApp_HistorySidebarConfig_NavigateCallbackNavigates(t *testing.T) { | |||||
| 1421 | } | 1421 | } | ||
| 1422 | 1422 | ||||
| 1423 | func TestApp_NavigateHistorySidebarSelection_KeepsSidebarVisible(t *testing.T) { | 1423 | func TestApp_NavigateHistorySidebarSelection_KeepsSidebarVisible(t *testing.T) { | ||
| 1424 | - | ctx := context.Background() | 1424 | + | ctx := t.Context() |
| 1425 | 1425 | ||||
| 1426 | paneID := entity.PaneID("pane-1") | 1426 | paneID := entity.PaneID("pane-1") | ||
| 1427 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | 1427 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | ||
| @@ -1464,7 +1464,7 @@ func TestApp_NavigateHistorySidebarSelection_KeepsSidebarVisible(t *testing.T) { | |||||
| 1464 | // OnNavigate targets the callback's owning window, not the globally focused | 1464 | // OnNavigate targets the callback's owning window, not the globally focused | ||
| 1465 | // window, when they differ. | 1465 | // window, when they differ. | ||
| 1466 | func TestApp_HistorySidebarConfig_NavigateCallbackOwnership(t *testing.T) { | 1466 | func TestApp_HistorySidebarConfig_NavigateCallbackOwnership(t *testing.T) { | ||
| 1467 | - | ctx := context.Background() | 1467 | + | ctx := t.Context() |
| 1468 | 1468 | ||||
| 1469 | tab1 := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | 1469 | tab1 := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(entity.PaneID("pane-1"))) | ||
| 1470 | tab2 := entity.NewTab(entity.TabID("tab-2"), entity.WorkspaceID("ws-2"), entity.NewPane(entity.PaneID("pane-2"))) | 1470 | tab2 := entity.NewTab(entity.TabID("tab-2"), entity.WorkspaceID("ws-2"), entity.NewPane(entity.PaneID("pane-2"))) | ||
| @@ -1519,7 +1519,7 @@ func TestApp_HistorySidebarConfig_NavigateCallbackOwnership(t *testing.T) { | |||||
| 1519 | // TestApp_HistorySidebarConfig_KeepOpenCallback verifies that | 1519 | // TestApp_HistorySidebarConfig_KeepOpenCallback verifies that | ||
| 1520 | // OnNavigateKeepOpen navigates the owning window without hiding the sidebar. | 1520 | // OnNavigateKeepOpen navigates the owning window without hiding the sidebar. | ||
| 1521 | func TestApp_HistorySidebarConfig_KeepOpenCallback(t *testing.T) { | 1521 | func TestApp_HistorySidebarConfig_KeepOpenCallback(t *testing.T) { | ||
| 1522 | - | ctx := context.Background() | 1522 | + | ctx := t.Context() |
| 1523 | 1523 | ||||
| 1524 | paneID := entity.PaneID("pane-1") | 1524 | paneID := entity.PaneID("pane-1") | ||
| 1525 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | 1525 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | ||
| @@ -1569,7 +1569,7 @@ func TestApp_HistorySidebarConfig_KeepOpenCallback(t *testing.T) { | |||||
| 1569 | // OnOpenInNewPane activates the owning browser window and creates a split | 1569 | // OnOpenInNewPane activates the owning browser window and creates a split | ||
| 1570 | // with the target URL. | 1570 | // with the target URL. | ||
| 1571 | func TestApp_HistorySidebarConfig_OpenInNewPaneCallback(t *testing.T) { | 1571 | func TestApp_HistorySidebarConfig_OpenInNewPaneCallback(t *testing.T) { | ||
| 1572 | - | ctx := context.Background() | 1572 | + | ctx := t.Context() |
| 1573 | 1573 | ||||
| 1574 | paneID := entity.PaneID("pane-1") | 1574 | paneID := entity.PaneID("pane-1") | ||
| 1575 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | 1575 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | ||
| @@ -1627,7 +1627,7 @@ func TestApp_HistorySidebarConfig_OpenInNewPaneCallback(t *testing.T) { | |||||
| 1627 | // TestApp_HistorySidebarConfig_CloseCallback verifies that OnClose hides the | 1627 | // TestApp_HistorySidebarConfig_CloseCallback verifies that OnClose hides the | ||
| 1628 | // sidebar for the owning browser window and restores focus to the active pane. | 1628 | // sidebar for the owning browser window and restores focus to the active pane. | ||
| 1629 | func TestApp_HistorySidebarConfig_CloseCallback(t *testing.T) { | 1629 | func TestApp_HistorySidebarConfig_CloseCallback(t *testing.T) { | ||
| 1630 | - | ctx := context.Background() | 1630 | + | ctx := t.Context() |
| 1631 | 1631 | ||||
| 1632 | paneID := entity.PaneID("pane-1") | 1632 | paneID := entity.PaneID("pane-1") | ||
| 1633 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | 1633 | tab := entity.NewTab(entity.TabID("tab-1"), entity.WorkspaceID("ws-1"), entity.NewPane(paneID)) | ||
| @@ -1674,7 +1674,7 @@ func TestApp_HistorySidebarConfig_CloseCallback(t *testing.T) { | |||||
| 1674 | // OnClose (hideAndRestoreFocusForBrowserWindow) is safe when the browser | 1674 | // OnClose (hideAndRestoreFocusForBrowserWindow) is safe when the browser | ||
| 1675 | // window has no sidebar or is nil. | 1675 | // window has no sidebar or is nil. | ||
| 1676 | func TestApp_HistorySidebarConfig_CloseWithNoSidebarIsSafe(t *testing.T) { | 1676 | func TestApp_HistorySidebarConfig_CloseWithNoSidebarIsSafe(t *testing.T) { | ||
| 1677 | - | ctx := context.Background() | 1677 | + | ctx := t.Context() |
| 1678 | 1678 | ||||
| 1679 | bw := &browserWindow{ | 1679 | bw := &browserWindow{ | ||
| 1680 | id: "no-sidebar", | 1680 | id: "no-sidebar", | ||
M internal/ui/component/history_model_test.go +10 -16
| @@ -417,8 +417,7 @@ func TestKeyboardNavModel_EntryCount(t *testing.T) { | |||
| 417 | 417 | // ============================================================================= | |
| 418 | 418 | ||
| 419 | 419 | func TestTransitionSearchState_EmptyQuery(t *testing.T) { | |
| 420 | - | initial := searchStateSnapshot{} | |
| 421 | - | next := transitionSearchState(initial, "", 0) | |
| 420 | + | next := transitionSearchState("", 0) | |
| 422 | 421 | assert.Equal(t, "", next.Query) | |
| 423 | 422 | assert.False(t, next.HasSearchDone) | |
| 424 | 423 | assert.False(t, next.HasResults) | |
| @@ -426,8 +425,7 @@ func TestTransitionSearchState_EmptyQuery(t *testing.T) { | |||
| 426 | 425 | } | |
| 427 | 426 | ||
| 428 | 427 | func TestTransitionSearchState_NewQuery(t *testing.T) { | |
| 429 | - | initial := searchStateSnapshot{} | |
| 430 | - | next := transitionSearchState(initial, "example", 5) | |
| 428 | + | next := transitionSearchState("example", 5) | |
| 431 | 429 | assert.Equal(t, "example", next.Query) | |
| 432 | 430 | assert.True(t, next.HasSearchDone) | |
| 433 | 431 | assert.True(t, next.HasResults) | |
| @@ -435,8 +433,7 @@ func TestTransitionSearchState_NewQuery(t *testing.T) { | |||
| 435 | 433 | } | |
| 436 | 434 | ||
| 437 | 435 | func TestTransitionSearchState_QueryWithNoResults(t *testing.T) { | |
| 438 | - | initial := searchStateSnapshot{} | |
| 439 | - | next := transitionSearchState(initial, "nonexistent", 0) | |
| 436 | + | next := transitionSearchState("nonexistent", 0) | |
| 440 | 437 | assert.Equal(t, "nonexistent", next.Query) | |
| 441 | 438 | assert.True(t, next.HasSearchDone) | |
| 442 | 439 | assert.False(t, next.HasResults) | |
| @@ -444,8 +441,7 @@ func TestTransitionSearchState_QueryWithNoResults(t *testing.T) { | |||
| 444 | 441 | } | |
| 445 | 442 | ||
| 446 | 443 | func TestTransitionSearchState_QueryToQuery(t *testing.T) { | |
| 447 | - | initial := searchStateSnapshot{Query: "old", HasSearchDone: true, HasResults: true, ResultCount: 3} | |
| 448 | - | next := transitionSearchState(initial, "new", 7) | |
| 444 | + | next := transitionSearchState("new", 7) | |
| 449 | 445 | assert.Equal(t, "new", next.Query) | |
| 450 | 446 | assert.True(t, next.HasSearchDone) | |
| 451 | 447 | assert.True(t, next.HasResults) | |
| @@ -453,8 +449,7 @@ func TestTransitionSearchState_QueryToQuery(t *testing.T) { | |||
| 453 | 449 | } | |
| 454 | 450 | ||
| 455 | 451 | func TestTransitionSearchState_QueryToEmpty(t *testing.T) { | |
| 456 | - | initial := searchStateSnapshot{Query: "old", HasSearchDone: true, HasResults: true, ResultCount: 3} | |
| 457 | - | next := transitionSearchState(initial, "", 0) | |
| 452 | + | next := transitionSearchState("", 0) | |
| 458 | 453 | assert.Equal(t, "", next.Query) | |
| 459 | 454 | assert.False(t, next.HasSearchDone) | |
| 460 | 455 | assert.False(t, next.HasResults) | |
| @@ -610,15 +605,14 @@ func TestKeyboardNavModel_EntryCountWithEmptyGroups(t *testing.T) { | |||
| 610 | 605 | // where a later result arrives after the gen has moved on. | |
| 611 | 606 | func TestTransitionSearchState_SequentialSearches(t *testing.T) { | |
| 612 | 607 | // Search 1: "foo" -> 5 results | |
| 613 | - | s1 := searchStateSnapshot{} | |
| 614 | - | next1 := transitionSearchState(s1, "foo", 5) | |
| 608 | + | next1 := transitionSearchState("foo", 5) | |
| 615 | 609 | assert.Equal(t, "foo", next1.Query) | |
| 616 | 610 | assert.True(t, next1.HasSearchDone) | |
| 617 | 611 | assert.True(t, next1.HasResults) | |
| 618 | 612 | assert.Equal(t, 5, next1.ResultCount) | |
| 619 | 613 | ||
| 620 | 614 | // Search 2: "foobar" -> 3 results (supersedes search 1) | |
| 621 | - | next2 := transitionSearchState(next1, "foobar", 3) | |
| 615 | + | next2 := transitionSearchState("foobar", 3) | |
| 622 | 616 | assert.Equal(t, "foobar", next2.Query) | |
| 623 | 617 | assert.True(t, next2.HasSearchDone) | |
| 624 | 618 | assert.True(t, next2.HasResults) | |
| @@ -631,21 +625,21 @@ func TestTransitionSearchState_SearchThenClearThenReSearch(t *testing.T) { | |||
| 631 | 625 | s := searchStateSnapshot{} | |
| 632 | 626 | ||
| 633 | 627 | // Search "term" -> 2 results | |
| 634 | - | s = transitionSearchState(s, "term", 2) | |
| 628 | + | s = transitionSearchState("term", 2) | |
| 635 | 629 | assert.Equal(t, "term", s.Query) | |
| 636 | 630 | assert.True(t, s.HasSearchDone) | |
| 637 | 631 | assert.True(t, s.HasResults) | |
| 638 | 632 | assert.Equal(t, 2, s.ResultCount) | |
| 639 | 633 | ||
| 640 | 634 | // Clear: query becomes "" | |
| 641 | - | s = transitionSearchState(s, "", 0) | |
| 635 | + | s = transitionSearchState("", 0) | |
| 642 | 636 | assert.Equal(t, "", s.Query) | |
| 643 | 637 | assert.False(t, s.HasSearchDone) | |
| 644 | 638 | assert.False(t, s.HasResults) | |
| 645 | 639 | assert.Equal(t, 0, s.ResultCount) | |
| 646 | 640 | ||
| 647 | 641 | // Re-search: new term | |
| 648 | - | s = transitionSearchState(s, "other", 7) | |
| 642 | + | s = transitionSearchState("other", 7) | |
| 649 | 643 | assert.Equal(t, "other", s.Query) | |
| 650 | 644 | assert.True(t, s.HasSearchDone) | |
| 651 | 645 | assert.True(t, s.HasResults) | |
| @@ -417,8 +417,7 @@ func TestKeyboardNavModel_EntryCount(t *testing.T) { | |||||
| 417 | // ============================================================================= | 417 | // ============================================================================= | ||
| 418 | 418 | ||||
| 419 | func TestTransitionSearchState_EmptyQuery(t *testing.T) { | 419 | func TestTransitionSearchState_EmptyQuery(t *testing.T) { | ||
| 420 | - | initial := searchStateSnapshot{} | 420 | + | next := transitionSearchState("", 0) |
| 421 | - | next := transitionSearchState(initial, "", 0) | |||
| 422 | assert.Equal(t, "", next.Query) | 421 | assert.Equal(t, "", next.Query) | ||
| 423 | assert.False(t, next.HasSearchDone) | 422 | assert.False(t, next.HasSearchDone) | ||
| 424 | assert.False(t, next.HasResults) | 423 | assert.False(t, next.HasResults) | ||
| @@ -426,8 +425,7 @@ func TestTransitionSearchState_EmptyQuery(t *testing.T) { | |||||
| 426 | } | 425 | } | ||
| 427 | 426 | ||||
| 428 | func TestTransitionSearchState_NewQuery(t *testing.T) { | 427 | func TestTransitionSearchState_NewQuery(t *testing.T) { | ||
| 429 | - | initial := searchStateSnapshot{} | 428 | + | next := transitionSearchState("example", 5) |
| 430 | - | next := transitionSearchState(initial, "example", 5) | |||
| 431 | assert.Equal(t, "example", next.Query) | 429 | assert.Equal(t, "example", next.Query) | ||
| 432 | assert.True(t, next.HasSearchDone) | 430 | assert.True(t, next.HasSearchDone) | ||
| 433 | assert.True(t, next.HasResults) | 431 | assert.True(t, next.HasResults) | ||
| @@ -435,8 +433,7 @@ func TestTransitionSearchState_NewQuery(t *testing.T) { | |||||
| 435 | } | 433 | } | ||
| 436 | 434 | ||||
| 437 | func TestTransitionSearchState_QueryWithNoResults(t *testing.T) { | 435 | func TestTransitionSearchState_QueryWithNoResults(t *testing.T) { | ||
| 438 | - | initial := searchStateSnapshot{} | 436 | + | next := transitionSearchState("nonexistent", 0) |
| 439 | - | next := transitionSearchState(initial, "nonexistent", 0) | |||
| 440 | assert.Equal(t, "nonexistent", next.Query) | 437 | assert.Equal(t, "nonexistent", next.Query) | ||
| 441 | assert.True(t, next.HasSearchDone) | 438 | assert.True(t, next.HasSearchDone) | ||
| 442 | assert.False(t, next.HasResults) | 439 | assert.False(t, next.HasResults) | ||
| @@ -444,8 +441,7 @@ func TestTransitionSearchState_QueryWithNoResults(t *testing.T) { | |||||
| 444 | } | 441 | } | ||
| 445 | 442 | ||||
| 446 | func TestTransitionSearchState_QueryToQuery(t *testing.T) { | 443 | func TestTransitionSearchState_QueryToQuery(t *testing.T) { | ||
| 447 | - | initial := searchStateSnapshot{Query: "old", HasSearchDone: true, HasResults: true, ResultCount: 3} | 444 | + | next := transitionSearchState("new", 7) |
| 448 | - | next := transitionSearchState(initial, "new", 7) | |||
| 449 | assert.Equal(t, "new", next.Query) | 445 | assert.Equal(t, "new", next.Query) | ||
| 450 | assert.True(t, next.HasSearchDone) | 446 | assert.True(t, next.HasSearchDone) | ||
| 451 | assert.True(t, next.HasResults) | 447 | assert.True(t, next.HasResults) | ||
| @@ -453,8 +449,7 @@ func TestTransitionSearchState_QueryToQuery(t *testing.T) { | |||||
| 453 | } | 449 | } | ||
| 454 | 450 | ||||
| 455 | func TestTransitionSearchState_QueryToEmpty(t *testing.T) { | 451 | func TestTransitionSearchState_QueryToEmpty(t *testing.T) { | ||
| 456 | - | initial := searchStateSnapshot{Query: "old", HasSearchDone: true, HasResults: true, ResultCount: 3} | 452 | + | next := transitionSearchState("", 0) |
| 457 | - | next := transitionSearchState(initial, "", 0) | |||
| 458 | assert.Equal(t, "", next.Query) | 453 | assert.Equal(t, "", next.Query) | ||
| 459 | assert.False(t, next.HasSearchDone) | 454 | assert.False(t, next.HasSearchDone) | ||
| 460 | assert.False(t, next.HasResults) | 455 | assert.False(t, next.HasResults) | ||
| @@ -610,15 +605,14 @@ func TestKeyboardNavModel_EntryCountWithEmptyGroups(t *testing.T) { | |||||
| 610 | // where a later result arrives after the gen has moved on. | 605 | // where a later result arrives after the gen has moved on. | ||
| 611 | func TestTransitionSearchState_SequentialSearches(t *testing.T) { | 606 | func TestTransitionSearchState_SequentialSearches(t *testing.T) { | ||
| 612 | // Search 1: "foo" -> 5 results | 607 | // Search 1: "foo" -> 5 results | ||
| 613 | - | s1 := searchStateSnapshot{} | 608 | + | next1 := transitionSearchState("foo", 5) |
| 614 | - | next1 := transitionSearchState(s1, "foo", 5) | |||
| 615 | assert.Equal(t, "foo", next1.Query) | 609 | assert.Equal(t, "foo", next1.Query) | ||
| 616 | assert.True(t, next1.HasSearchDone) | 610 | assert.True(t, next1.HasSearchDone) | ||
| 617 | assert.True(t, next1.HasResults) | 611 | assert.True(t, next1.HasResults) | ||
| 618 | assert.Equal(t, 5, next1.ResultCount) | 612 | assert.Equal(t, 5, next1.ResultCount) | ||
| 619 | 613 | ||||
| 620 | // Search 2: "foobar" -> 3 results (supersedes search 1) | 614 | // Search 2: "foobar" -> 3 results (supersedes search 1) | ||
| 621 | - | next2 := transitionSearchState(next1, "foobar", 3) | 615 | + | next2 := transitionSearchState("foobar", 3) |
| 622 | assert.Equal(t, "foobar", next2.Query) | 616 | assert.Equal(t, "foobar", next2.Query) | ||
| 623 | assert.True(t, next2.HasSearchDone) | 617 | assert.True(t, next2.HasSearchDone) | ||
| 624 | assert.True(t, next2.HasResults) | 618 | assert.True(t, next2.HasResults) | ||
| @@ -631,21 +625,21 @@ func TestTransitionSearchState_SearchThenClearThenReSearch(t *testing.T) { | |||||
| 631 | s := searchStateSnapshot{} | 625 | s := searchStateSnapshot{} | ||
| 632 | 626 | ||||
| 633 | // Search "term" -> 2 results | 627 | // Search "term" -> 2 results | ||
| 634 | - | s = transitionSearchState(s, "term", 2) | 628 | + | s = transitionSearchState("term", 2) |
| 635 | assert.Equal(t, "term", s.Query) | 629 | assert.Equal(t, "term", s.Query) | ||
| 636 | assert.True(t, s.HasSearchDone) | 630 | assert.True(t, s.HasSearchDone) | ||
| 637 | assert.True(t, s.HasResults) | 631 | assert.True(t, s.HasResults) | ||
| 638 | assert.Equal(t, 2, s.ResultCount) | 632 | assert.Equal(t, 2, s.ResultCount) | ||
| 639 | 633 | ||||
| 640 | // Clear: query becomes "" | 634 | // Clear: query becomes "" | ||
| 641 | - | s = transitionSearchState(s, "", 0) | 635 | + | s = transitionSearchState("", 0) |
| 642 | assert.Equal(t, "", s.Query) | 636 | assert.Equal(t, "", s.Query) | ||
| 643 | assert.False(t, s.HasSearchDone) | 637 | assert.False(t, s.HasSearchDone) | ||
| 644 | assert.False(t, s.HasResults) | 638 | assert.False(t, s.HasResults) | ||
| 645 | assert.Equal(t, 0, s.ResultCount) | 639 | assert.Equal(t, 0, s.ResultCount) | ||
| 646 | 640 | ||||
| 647 | // Re-search: new term | 641 | // Re-search: new term | ||
| 648 | - | s = transitionSearchState(s, "other", 7) | 642 | + | s = transitionSearchState("other", 7) |
| 649 | assert.Equal(t, "other", s.Query) | 643 | assert.Equal(t, "other", s.Query) | ||
| 650 | assert.True(t, s.HasSearchDone) | 644 | assert.True(t, s.HasSearchDone) | ||
| 651 | assert.True(t, s.HasResults) | 645 | assert.True(t, s.HasResults) | ||
M internal/ui/component/history_sidebar_search_test.go +4 -4
| @@ -164,7 +164,7 @@ func TestApplySearchResults_StaleGenerationDropsResultsAfterSearch(t *testing.T) | |||
| 164 | 164 | } | |
| 165 | 165 | ||
| 166 | 166 | hs := newTestSidebarSearchHarness() | |
| 167 | - | hs.ctx = context.Background() | |
| 167 | + | hs.ctx = t.Context() | |
| 168 | 168 | hs.historyUC = history | |
| 169 | 169 | hs.searchGen = 1 | |
| 170 | 170 | hs.idleScheduler = func(cb glib.SourceFunc) { | |
| @@ -212,7 +212,7 @@ func TestApplySearchResults_CurrentGenerationAppliedAfterSearch(t *testing.T) { | |||
| 212 | 212 | } | |
| 213 | 213 | ||
| 214 | 214 | hs := newTestSidebarSearchHarness() | |
| 215 | - | hs.ctx = context.Background() | |
| 215 | + | hs.ctx = t.Context() | |
| 216 | 216 | hs.historyUC = history | |
| 217 | 217 | hs.searchGen = 1 | |
| 218 | 218 | hs.idleScheduler = func(cb glib.SourceFunc) { | |
| @@ -260,7 +260,7 @@ func TestHistorySidebar_ReloadPreservesQuery(t *testing.T) { | |||
| 260 | 260 | hs := newTestSidebarSearchHarness() | |
| 261 | 261 | hs.currentQuery = "preserved" | |
| 262 | 262 | hs.historyUC = history | |
| 263 | - | hs.ctx = context.Background() | |
| 263 | + | hs.ctx = t.Context() | |
| 264 | 264 | ||
| 265 | 265 | hs.mu.Lock() | |
| 266 | 266 | oldGen := hs.searchGen | |
| @@ -314,7 +314,7 @@ func TestFetchPage_StaleGenerationDoesNotMutateLoadingState(t *testing.T) { | |||
| 314 | 314 | } | |
| 315 | 315 | ||
| 316 | 316 | hs := newTestSidebarSearchHarness() | |
| 317 | - | hs.ctx = context.Background() | |
| 317 | + | hs.ctx = t.Context() | |
| 318 | 318 | hs.historyUC = history | |
| 319 | 319 | ||
| 320 | 320 | // Simulate: gen 1 started, then gen 2 started (e.g. by Reload/Show). | |
| @@ -164,7 +164,7 @@ func TestApplySearchResults_StaleGenerationDropsResultsAfterSearch(t *testing.T) | |||||
| 164 | } | 164 | } | ||
| 165 | 165 | ||||
| 166 | hs := newTestSidebarSearchHarness() | 166 | hs := newTestSidebarSearchHarness() | ||
| 167 | - | hs.ctx = context.Background() | 167 | + | hs.ctx = t.Context() |
| 168 | hs.historyUC = history | 168 | hs.historyUC = history | ||
| 169 | hs.searchGen = 1 | 169 | hs.searchGen = 1 | ||
| 170 | hs.idleScheduler = func(cb glib.SourceFunc) { | 170 | hs.idleScheduler = func(cb glib.SourceFunc) { | ||
| @@ -212,7 +212,7 @@ func TestApplySearchResults_CurrentGenerationAppliedAfterSearch(t *testing.T) { | |||||
| 212 | } | 212 | } | ||
| 213 | 213 | ||||
| 214 | hs := newTestSidebarSearchHarness() | 214 | hs := newTestSidebarSearchHarness() | ||
| 215 | - | hs.ctx = context.Background() | 215 | + | hs.ctx = t.Context() |
| 216 | hs.historyUC = history | 216 | hs.historyUC = history | ||
| 217 | hs.searchGen = 1 | 217 | hs.searchGen = 1 | ||
| 218 | hs.idleScheduler = func(cb glib.SourceFunc) { | 218 | hs.idleScheduler = func(cb glib.SourceFunc) { | ||
| @@ -260,7 +260,7 @@ func TestHistorySidebar_ReloadPreservesQuery(t *testing.T) { | |||||
| 260 | hs := newTestSidebarSearchHarness() | 260 | hs := newTestSidebarSearchHarness() | ||
| 261 | hs.currentQuery = "preserved" | 261 | hs.currentQuery = "preserved" | ||
| 262 | hs.historyUC = history | 262 | hs.historyUC = history | ||
| 263 | - | hs.ctx = context.Background() | 263 | + | hs.ctx = t.Context() |
| 264 | 264 | ||||
| 265 | hs.mu.Lock() | 265 | hs.mu.Lock() | ||
| 266 | oldGen := hs.searchGen | 266 | oldGen := hs.searchGen | ||
| @@ -314,7 +314,7 @@ func TestFetchPage_StaleGenerationDoesNotMutateLoadingState(t *testing.T) { | |||||
| 314 | } | 314 | } | ||
| 315 | 315 | ||||
| 316 | hs := newTestSidebarSearchHarness() | 316 | hs := newTestSidebarSearchHarness() | ||
| 317 | - | hs.ctx = context.Background() | 317 | + | hs.ctx = t.Context() |
| 318 | hs.historyUC = history | 318 | hs.historyUC = history | ||
| 319 | 319 | ||||
| 320 | // Simulate: gen 1 started, then gen 2 started (e.g. by Reload/Show). | 320 | // Simulate: gen 1 started, then gen 2 started (e.g. by Reload/Show). | ||
M internal/ui/component/history_test_helpers_test.go +1 -1
| @@ -10,7 +10,7 @@ type searchStateSnapshot struct { | |||
| 10 | 10 | } | |
| 11 | 11 | ||
| 12 | 12 | // transitionSearchState models a search state transition for tests without GTK. | |
| 13 | - | func transitionSearchState(_ searchStateSnapshot, newQuery string, resultCount int) searchStateSnapshot { | |
| 13 | + | func transitionSearchState(newQuery string, resultCount int) searchStateSnapshot { | |
| 14 | 14 | return searchStateSnapshot{ | |
| 15 | 15 | Query: newQuery, | |
| 16 | 16 | HasSearchDone: newQuery != "", | |
| @@ -10,7 +10,7 @@ type searchStateSnapshot struct { | |||||
| 10 | } | 10 | } | ||
| 11 | 11 | ||||
| 12 | // transitionSearchState models a search state transition for tests without GTK. | 12 | // transitionSearchState models a search state transition for tests without GTK. | ||
| 13 | - | func transitionSearchState(_ searchStateSnapshot, newQuery string, resultCount int) searchStateSnapshot { | 13 | + | func transitionSearchState(newQuery string, resultCount int) searchStateSnapshot { |
| 14 | return searchStateSnapshot{ | 14 | return searchStateSnapshot{ | ||
| 15 | Query: newQuery, | 15 | Query: newQuery, | ||
| 16 | HasSearchDone: newQuery != "", | 16 | HasSearchDone: newQuery != "", | ||