mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-22 06:56:35 +00:00
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.
This commit is contained in:
@@ -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(<MBottomNav />, { 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(<MBottomNav />, { 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(<MBottomNav />, { 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(<MBottomNav />, { initialEntries: ['/dashboard'] });
|
||||
@@ -126,7 +142,7 @@ describe('MBottomNav', () => {
|
||||
render(<MBottomNav />, { 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');
|
||||
|
||||
@@ -36,8 +36,8 @@ describe('MMobileNavCustomizer', () => {
|
||||
it('FE-MOB-SETNAVC-001: an uncustomised value falls back to the built-in dock split', () => {
|
||||
render(<MMobileNavCustomizer value={{ bar: [], more: [] }} onChange={vi.fn()} />);
|
||||
|
||||
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', () => {
|
||||
|
||||
Reference in New Issue
Block a user