// ============================================================ // PE GUIDE (React port) — smoke tests for the reference page. // // Covers the subset that landed in the first commit: scales, // APTM legend, innocent murmurs, respiratory + cardiac sound // libraries. The full PE_DATA exam-step checklist is still in // the legacy viewer and linked to from the amber banner. // ============================================================ const { test, expect, E2E_BASE } = require('../fixtures'); async function openReactPeGuide(page) { await page.goto(E2E_BASE + '/app/peguide'); await page.waitForSelector('[data-testid^="scale-"]', { timeout: 15000 }); } test.describe('React PE Guide — reference content renders', () => { test('all 12 scales render (MRC, DTR, Plantar, Beighton, ATR, RR, SpO2, Silverman, Westley, murmur Levine, pulse amp, cap refill)', async ({ authedPage: _, page }) => { await openReactPeGuide(page); const count = await page.locator('[data-testid^="scale-"]').count(); expect(count).toBe(12); }); test('APTM legend shows all 5 points (A, P, E, T, M)', async ({ authedPage: _, page }) => { await openReactPeGuide(page); for (const letter of ['a', 'p', 'e', 't', 'm']) { await expect(page.locator('[data-testid="aptm-' + letter + '"]')).toBeVisible(); } }); test('sound libraries: 7 respiratory + 6 cardiac entries', async ({ authedPage: _, page }) => { await openReactPeGuide(page); const respiratoryKeys = ['normal', 'wheeze', 'stridor', 'finecrackles', 'coarsecrackles', 'rhonchi', 'pleuralrub']; const cardiacKeys = ['normal', 'infant-normal', 'vsd', 'mvp', 'stills', 'functional']; for (const k of respiratoryKeys) { expect(await page.locator('[data-testid="sound-' + k + '"]').count()).toBeGreaterThan(0); } for (const k of cardiacKeys) { expect(await page.locator('[data-testid="sound-' + k + '"]').count()).toBeGreaterThan(0); } }); test('legacy-viewer link for exam-step checklist is present', async ({ authedPage: _, page }) => { await openReactPeGuide(page); await expect(page.getByText('Open checklist in legacy viewer')).toBeVisible(); }); });