From 7ec9d514ec8dc8afca83a075e00d18c2bb42d5dc Mon Sep 17 00:00:00 2001 From: Niek Otten Date: Mon, 13 Jul 2026 16:15:43 +0200 Subject: [PATCH] test(e2e): assert the submitted registration becomes publicly visible (refs #10) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the walking-skeleton happy path: after the self-service submit + confirmation, open the anonymous openbaar register portal and poll (reload) until the submitted INGEDIEND entry appears — completing submit → BFF → domain → projection → public visibility. Verified the openbaar portal renders the public-safe register (id+status, no bsn) against a real BFF + stub projection. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/e2e/registration.spec.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/e2e/registration.spec.ts b/tests/e2e/registration.spec.ts index e446bdb..216bb0d 100644 --- a/tests/e2e/registration.spec.ts +++ b/tests/e2e/registration.spec.ts @@ -1,8 +1,9 @@ import { expect, test } from '@playwright/test'; -// Walking-skeleton happy path (S-08d): a zorgprofessional logs in via mock DigiD and submits a -// registration through the self-service portal → BFF → domain. The confirmation shows the reference. -test('DigiD login → submit → confirmation', async ({ page }) => { +// Walking-skeleton happy path (S-08d + S-09): a zorgprofessional logs in via mock DigiD and submits a +// registration through the self-service portal → BFF → domain; the projection is updated via NRC → the +// event-subscriber, and the entry becomes publicly visible in the openbaar register portal. +test('DigiD login → submit → confirmation → public visibility', async ({ page }) => { // Visiting the guarded page redirects to the Keycloak (mock DigiD) login. await page.goto('/'); @@ -18,4 +19,16 @@ test('DigiD login → submit → confirmation', async ({ page }) => { // The BFF accepted it and the page shows the confirmation. await expect(page.getByText(/ontvangen/i)).toBeVisible(); + + // The openbaar register (anonymous, its own origin) shows the submitted entry once the projection + // catches up. The projection updates asynchronously (NRC → event-subscriber), and the register loads + // on open, so reload until a submitted (INGEDIEND) row appears. + await page.goto('http://openbaar/'); + await expect(page.getByRole('heading', { name: /Openbaar BIG-register/i })).toBeVisible(); + await expect + .poll(async () => { + await page.reload(); + return page.getByRole('cell', { name: 'INGEDIEND' }).count(); + }, { timeout: 30_000, intervals: [1_000, 2_000, 3_000, 5_000] }) + .toBeGreaterThan(0); });