/** * No raw UUID should ever leak into visible copy where a name belongs (the * historical bug: "3d6c6b2e-… has a large surplus" instead of a parent's * name — see the surplus-advice/name-resolver code in * `src/components/planning/PlanResults.tsx` and `src/utils/parentNames.ts`). * Cheap to guard forever; scans the rendered text of every main page. */ import { test, expect } from '@playwright/test' import { MAIN_PAGES } from '../support/pages' const UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i test.describe('no raw UUIDs in visible copy', () => { for (const mainPage of MAIN_PAGES) { test(`${mainPage.name} (${mainPage.path}) never shows a raw id where a name belongs`, async ({ page }) => { await page.goto(mainPage.path) const root = page.getByTestId(mainPage.testId) await expect(root).toBeVisible() const text = await root.innerText() const match = text.match(UUID_PATTERN) expect(match?.[0] ?? null, `found a raw UUID in visible text on ${mainPage.path}`).toBeNull() }) } })