fix(ci): unbreak backend format, storybook-a11y, and e2e jobs
- backend: dotnet format the WP-51 migration (2-space indent, no BOM) to match .editorconfig — dotnet format --verify-no-changes was failing. - storybook: stub FeatureFlagStore (WP-47) in shell/site-header stories alongside AccessStore, fixing NG0201 no-provider errors; bump the storybook-a11y container's memory cap 4g→6g (build-storybook + compodoc measured ~5.8GB peak RSS, leaving too little headroom). - backend: fix a startup-breaking bug in the new (WP-52) POST /zgw/notificaties handler — it took ZgwOptions as a minimal-API parameter, which isn't registered in DI, so ASP.NET's endpoint-table build threw on every request once the route was registered (incl. /swagger, which is why Playwright's webServer health check timed out). Close over the existing `zgw` local instead. - e2e: brief-v2.spec.ts's "Voorbeeld" button locator was ambiguous once a second "Voorbeeld met testwaarden" button existed (Playwright name matching is substring-based) — added `exact: true`. Also fixed the sent-letter preview flow to match app-letter-composer's actual behavior (single click → fetch, no in-page dialog, unlike app-behandel-scherm's), and fixed a watermark assertion that checked for the always-present `.preview-watermark` CSS class name instead of the conditionally-rendered "VOORBEELD" marker text. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+11
-6
@@ -33,13 +33,15 @@ test('drafter composes → approver sends; admin republishes appearance', async
|
||||
await expect(page.getByText('Concept opgeslagen')).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
// --- Preview: draft is watermarked ---
|
||||
await page.getByRole('button', { name: 'Voorbeeld' }).click();
|
||||
await page.getByRole('button', { name: 'Voorbeeld', exact: true }).click();
|
||||
const [draftPreview] = await Promise.all([
|
||||
page.waitForResponse((r) => r.url().includes('/api/v1/brief/preview'), { timeout: 10_000 }),
|
||||
page.getByRole('button', { name: 'Openen als document (PDF)' }).click(),
|
||||
]);
|
||||
expect(draftPreview.headers()['content-type']).toContain('text/html');
|
||||
expect(await draftPreview.text()).toContain('preview-watermark');
|
||||
// The `.preview-watermark` CSS rule ships in every preview (draft or sent) — only the
|
||||
// "VOORBEELD" marker div (LetterHtml.Render's `watermark` param) is actually conditional.
|
||||
expect(await draftPreview.text()).toContain('>VOORBEELD<');
|
||||
await page.getByRole('button', { name: 'Sluiten' }).click();
|
||||
|
||||
// --- Submit → approve → send (role change = full navigation, per WP-33 stickiness) ---
|
||||
@@ -52,13 +54,16 @@ test('drafter composes → approver sends; admin republishes appearance', async
|
||||
await expect(page.getByText('De brief is verzonden.')).toBeVisible();
|
||||
|
||||
// --- Preview: sent letter serves its frozen, unwatermarked archive ---
|
||||
await page.getByRole('button', { name: 'Voorbeeld' }).click();
|
||||
// Sent = !canEdit → app-letter-composer, whose "Voorbeeld" click goes straight to
|
||||
// store.previewLetter() (fetch + window.open), unlike the drafter's behandel-scherm
|
||||
// dialog above where "Voorbeeld" only opens a local modal and a second click inside it
|
||||
// triggers the fetch.
|
||||
const [sentPreview] = await Promise.all([
|
||||
page.waitForResponse((r) => r.url().includes('/api/v1/brief/preview'), { timeout: 10_000 }),
|
||||
page.getByRole('button', { name: 'Openen als document (PDF)' }).click(),
|
||||
page.getByRole('button', { name: 'Voorbeeld', exact: true }).click(),
|
||||
]);
|
||||
expect(sentPreview.headers()['content-type']).toContain('text/html');
|
||||
expect(await sentPreview.text()).not.toContain('preview-watermark');
|
||||
expect(await sentPreview.text()).not.toContain('>VOORBEELD<');
|
||||
|
||||
// --- Admin republishes the appearance ---
|
||||
await page.goto('/brief/huisstijl?role=admin');
|
||||
@@ -80,7 +85,7 @@ test('drafter composes → approver sends; admin republishes appearance', async
|
||||
// --- Drafter's canvas reflects the new appearance on a fresh letter ---
|
||||
await page.goto('/brief?role=drafter');
|
||||
await page.getByRole('button', { name: 'Opnieuw beginnen (demo)' }).click();
|
||||
await page.getByRole('button', { name: 'Voorbeeld' }).click();
|
||||
await page.getByRole('button', { name: 'Voorbeeld', exact: true }).click();
|
||||
await expect(page.locator('dialog')).toContainText(unique);
|
||||
await page.getByRole('button', { name: 'Sluiten' }).click();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user