From 569f0ca1a5f8189b49034f883f40a267a0289989 Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 7 Sep 2026 23:37:43 +0200 Subject: [PATCH] test(mobile-nav): follow the new default dock through the mobile suites Three expectations still described the Vacay/Atlas dock. Two of them asserted the old arrangement by name, so they were pinning the very thing that changed rather than catching a regression. FE-MOB-NAV-006 now watches Atlas take the demoted seat next to Collections, and picks Atlas out of the popover in FE-MOB-NAV-011 for the same reason. Two new cases cover what the change is actually about: Journey sits in the dock when it is enabled, and an instance without the addon still gets Vacay and Atlas. --- client/tests/unit/mobile/MBottomNav.test.tsx | 24 +++++++++++++++---- .../settings/MMobileNavCustomizer.test.tsx | 4 ++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/client/tests/unit/mobile/MBottomNav.test.tsx b/client/tests/unit/mobile/MBottomNav.test.tsx index 4c4cea8e6..c2cd945e6 100644 --- a/client/tests/unit/mobile/MBottomNav.test.tsx +++ b/client/tests/unit/mobile/MBottomNav.test.tsx @@ -89,16 +89,32 @@ describe('MBottomNav', () => { expect(screen.getByRole('button', { name: 'Manual Booking' })).toBeInTheDocument(); }); - it('FE-MOB-NAV-006: journey and collections live in the More popover, not the dock', () => { + it('FE-MOB-NAV-006: atlas and collections live in the More popover, not the dock', () => { seedAddons(['vacay', 'atlas', 'journey', 'collections']); render(, { initialEntries: ['/dashboard'] }); - expect(screen.queryByRole('button', { name: 'Journey' })).not.toBeInTheDocument(); + expect(screen.queryByRole('button', { name: 'Atlas' })).not.toBeInTheDocument(); fireEvent.click(screen.getByRole('button', { expanded: false })); - expect(screen.getByRole('button', { name: /Journey/ })).toBeInTheDocument(); + expect(screen.getByRole('button', { name: /Atlas/ })).toBeInTheDocument(); expect(screen.getByRole('button', { name: /Collections/ })).toBeInTheDocument(); }); + it('FE-MOB-NAV-006b: the dock keeps Journey next to Vacay when both are enabled', () => { + seedAddons(['vacay', 'atlas', 'journey', 'collections']); + render(, { initialEntries: ['/dashboard'] }); + + expect(screen.getByRole('button', { name: 'Journey' })).toBeInTheDocument(); + expect(screen.getByRole('button', { name: 'Vacay' })).toBeInTheDocument(); + }); + + it('FE-MOB-NAV-006c: an instance without the journey addon keeps the Vacay/Atlas dock', () => { + seedAddons(['vacay', 'atlas', 'collections']); + render(, { initialEntries: ['/dashboard'] }); + + expect(screen.getByRole('button', { name: 'Vacay' })).toBeInTheDocument(); + expect(screen.getByRole('button', { name: 'Atlas' })).toBeInTheDocument(); + }); + it('FE-MOB-NAV-007: no More slot without popover entries', () => { seedAddons(['vacay', 'atlas']); render(, { initialEntries: ['/dashboard'] }); @@ -126,7 +142,7 @@ describe('MBottomNav', () => { render(, { initialEntries: ['/dashboard'] }); fireEvent.click(screen.getByRole('button', { name: 'More' })); - fireEvent.click(screen.getByRole('button', { name: /Journey/ })); + fireEvent.click(screen.getByRole('button', { name: /Atlas/ })); const more = screen.getByRole('button', { name: 'More' }); expect(more).toHaveAttribute('aria-expanded', 'false'); diff --git a/client/tests/unit/mobile/settings/MMobileNavCustomizer.test.tsx b/client/tests/unit/mobile/settings/MMobileNavCustomizer.test.tsx index 048d830f9..773fea4e7 100644 --- a/client/tests/unit/mobile/settings/MMobileNavCustomizer.test.tsx +++ b/client/tests/unit/mobile/settings/MMobileNavCustomizer.test.tsx @@ -36,8 +36,8 @@ describe('MMobileNavCustomizer', () => { it('FE-MOB-SETNAVC-001: an uncustomised value falls back to the built-in dock split', () => { render(); - expect(rowLabels('In the bar')).toEqual(['Vacay', 'Atlas']); - expect(rowLabels('Under “More”')).toEqual(['Journey', 'Collections']); + expect(rowLabels('In the bar')).toEqual(['Vacay', 'Journey']); + expect(rowLabels('Under “More”')).toEqual(['Atlas', 'Collections']); }); it('FE-MOB-SETNAVC-002: Dashboard is listed pinned and has no reorder buttons', () => {