FN-7278: harden desktop mission swipe-back coverage

Clarify the desktop swipe-back regression test so it proves mission navigation never mutates browser history.\n\n- Select a mission before asserting desktop history behavior.\n- Cover both activity and structure tab switching with no pushState calls.\n- Rename the test to reflect post-selection desktop navigation coverage.\n\nFiles changed:\n .../__tests__/MissionManager.swipe-back.test.tsx           | 14 +++++++++++---\n 1 file changed, 11 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-7278

Fusion-Task-Lineage: aba55b01-dd9e-4714-b169-55b30ad5b580

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
This commit is contained in:
gsxdsm
2026-06-30 08:35:07 -07:00
parent 52e4a260c4
commit 5814049023

View File

@@ -209,17 +209,25 @@ describe("MissionManager mobile swipe-back", () => {
await expectMissionListVisible();
});
it("does not push a nav entry on desktop mission selection or tab switching", async () => {
it("does not push a nav entry after desktop mission selection or tab switching", async () => {
mockViewportMode.mockReturnValue("desktop");
renderMissionManager();
await userSelectMission();
await waitFor(() => {
expect(screen.getByText("Database Schema")).toBeInTheDocument();
});
fireEvent.click(screen.getByTestId("mission-tab-activity"));
expect(window.history.pushState).not.toHaveBeenCalled();
await openActivityTab();
expect(screen.getByTestId("mission-activity-tab")).toBeInTheDocument();
expect(screen.getByText("Activity tab loaded")).toBeInTheDocument();
expect(window.history.pushState).not.toHaveBeenCalled();
fireEvent.click(screen.getByTestId("mission-tab-structure"));
await waitFor(() => {
expect(screen.getByTestId("mission-activity-tab")).toBeInTheDocument();
expect(screen.getByText("Database Schema")).toBeInTheDocument();
});
expect(window.history.pushState).not.toHaveBeenCalled();
});