// FE-COMP-TRIPPDF-001 to FE-COMP-TRIPPDF-010 import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { http, HttpResponse } from 'msw' import { downloadTripPDF } from './TripPDF' import { server } from '../../../tests/helpers/msw/server' import { clearExchangeRateCache } from '../../hooks/useExchangeRates' import { getMergedItems, getTransportForDay } from '../../utils/dayMerge' // ── Helpers ─────────────────────────────────────────────────────────────────── const minimalArgs = { trip: { id: 1, title: 'My Trip', description: null, cover_image: null } as any, days: [{ id: 1, day_number: 1, title: null, date: '2025-06-01' }] as any[], places: [], assignments: {}, categories: [], dayNotes: [], reservations: [], t: (key: string, params?: any) => { if (params?.n !== undefined) return `Day ${params.n}` return key }, locale: 'en-US', } function getOverlay(): HTMLElement | null { return document.getElementById('pdf-preview-overlay') } function getIframe(): HTMLIFrameElement | null { return document.querySelector('#pdf-preview-overlay iframe') } /** The cover's "Planned" figure. The stat is read off its label, since days and places print the same markup. */ function plannedStat(html: string): number | null { const match = /
| Item | ') expect(html).toContain('Socks | ') expect(html).toContain('Bare') }) }) // FE-W5PDF-021 to FE-W5PDF-026 — the defaulting arms of the exporter. describe('downloadTripPDF defaults', () => { type Args = Parameters
|---|