FN-7529: fix desktop header search test
Update the App test to assert the open desktop search panel state after rerender.\n\n- Avoid re-clicking the desktop search toggle after the non-mobile panel stays open across rerender.\n- Assert the branch-filter selects directly while the search panel remains rendered.\n\nFiles changed:\n packages/dashboard/app/components/__tests__/App.test.tsx | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-) Fusion-Task-Id: FN-7529 Fusion-Task-Lineage: 1495f872-d262-4ea4-83f2-5a53ecf7a202 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
This commit is contained in:
@@ -4352,8 +4352,13 @@ describe("App board branch filters", () => {
|
||||
rerender(<App />);
|
||||
await waitForAppShell();
|
||||
|
||||
fireEvent.click(screen.getByTestId("desktop-header-search-btn"));
|
||||
|
||||
/*
|
||||
* FNXC:BoardSearch 2026-07-04-13:30: The non-mobile search panel intentionally stays open
|
||||
* across a same-instance rerender (Header's isNonMobileSearchOpen state is not project-scoped),
|
||||
* so the toggle button correctly unmounts once the panel is open (see canShowNonMobileSearchToggle
|
||||
* in Header.tsx) and there is no button left to re-click here. The branch-filter selects remain
|
||||
* rendered while the panel is open, so read them directly instead of re-clicking the toggle.
|
||||
*/
|
||||
expect((screen.getByTestId("working-branch-filter") as HTMLSelectElement).value).toBe("");
|
||||
expect((screen.getByTestId("target-branch-filter") as HTMLSelectElement).value).toBe("");
|
||||
expect(localStorage.getItem(scopedProjectKey(WORKING_BRANCH_FILTER_STORAGE_KEY, projectTwoId))).toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user