import { mockMatchMedia, mockResizeObserver, render, screen, userEvent } from '../test-utils'; import { resetLiveRegionAnnouncementQueue } from '../common/LiveRegion/LiveRegion'; import FlowNavigation from './FlowNavigation'; mockMatchMedia(); mockResizeObserver(); describe('FlowNavigation banner', () => { beforeEach(() => { resetLiveRegionAnnouncementQueue(); }); it('renders nothing when banner is not provided', () => { render(); expect(screen.queryByRole('region')).not.toBeInTheDocument(); }); it('renders the banner when passed as CriticalBannerProps', () => { render( , ); expect(screen.getByText('Action required')).toBeInTheDocument(); expect(screen.getByText('Please verify your identity.')).toBeInTheDocument(); }); it('maps and renders the banner when passed as CriticalBannerData', () => { render( , ); expect(screen.getByText('Action required')).toBeInTheDocument(); expect(screen.getByText('Your account requires attention')).toBeInTheDocument(); }); });