import { describe, it, expect, beforeEach } from 'vitest' import { http } from 'msw' import { server } from './msw/server' import { jsonResponse, paginate } from './msw/helpers' import { renderWithProviders, screen, waitFor } from './helpers/render' import { seedBearer, clearBearer } from './helpers/auth' import { FlightProvider, Header } from '../src/components' // AZ-469 — Browser support + responsive variants. // // AC-1 (FT-P-34): Chromium + Firefox smoke on /flights, /annotations, /dataset. // Pure e2e (Playwright two-project config) — covered in // e2e/tests/browser_support_responsive.e2e.ts. // AC-2 (FT-P-35): At viewport 480 px the bottom-nav is rendered; the desktop // top-bar is hidden. Tailwind drives this via `sm:hidden` / // `hidden sm:flex`. JSDOM does not compute media queries, so // the fast test asserts the structural marker — i.e., the // bottom-nav element exists with the `sm:hidden` class chain // and the top-bar carries `hidden sm:flex`. The actual // visibility is asserted in the e2e companion via a real // viewport. // AC-3 (FT-P-36): At viewport 1024 px the top-bar is rendered; the bottom-nav // is hidden. Symmetric to AC-2 — same fast/e2e split. function rigHeaderEnv(): void { server.use( http.get('/api/admin/auth/refresh', () => new Response(null, { status: 401 })), http.get('/api/flights', () => jsonResponse(paginate([], 1, 1000))), http.get('/api/annotations/settings/user', () => new Response(null, { status: 404 })), ) } function getTopNav(): HTMLElement | null { // The desktop nav is the first