fix(e2e): poll the register by reference, not a shared INGEDIEND cell (refs #78)
All checks were successful
CI / lint (pull_request) Successful in 1m23s
CI / build (pull_request) Successful in 1m17s
CI / unit (pull_request) Successful in 1m36s
CI / frontend (pull_request) Successful in 2m30s
CI / mutation (pull_request) Successful in 5m40s
CI / verify-stack (pull_request) Successful in 7m16s

The verify stack is shared: earlier verify-projection/verify-domain checks leave
INGEDIEND rows in the register before the e2e submits. A status-only poll
short-circuited on a stale row, then the reference assertion ran against a
not-yet-reloaded page and timed out. Poll (with reload) on this submission's
reference cell instead — stronger, and it directly proves the #78 correlation.
Scope the INGEDIEND/INGESCHREVEN status checks to that reference row too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 15:36:24 +02:00
parent 78e6c1d3d2
commit f2d79919c4

View File

@@ -26,19 +26,22 @@ test('DigiD login → submit → public INGEDIEND → approve → public INGESCH
// The openbaar register (anonymous, its own origin) shows the submitted entry once the projection // 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 // catches up. The projection updates asynchronously (NRC → event-subscriber), and the register loads
// on open, so reload until a submitted (INGEDIEND) row appears. // on open, so reload until *this* submission's row appears. We poll on the reference cell (not a
// generic INGEDIEND cell): the shared verify stack already holds INGEDIEND rows from earlier checks,
// so a status-only poll would short-circuit on a stale row before our row is projected.
await page.goto('http://openbaar/'); await page.goto('http://openbaar/');
await expect(page.getByRole('heading', { name: /Openbaar BIG-register/i })).toBeVisible(); 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);
// #78: the reference shown in the public register must be the exact one the citizen saw on the // #78: the reference shown in the public register must be the exact one the citizen saw on the
// submit confirmation — no mismatch between the two portals. // submit confirmation — no mismatch between the two portals.
await expect(page.getByRole('cell', { name: reference })).toBeVisible(); await expect
.poll(async () => {
await page.reload();
return page.getByRole('cell', { name: reference }).count();
}, { timeout: 30_000, intervals: [1_000, 2_000, 3_000, 5_000] })
.toBeGreaterThan(0);
await expect(page.getByRole('row', { name: reference }).getByRole('cell', { name: 'INGEDIEND' }))
.toBeVisible();
// Approve via the temporary admin endpoint (reached directly on the compose network, as a // Approve via the temporary admin endpoint (reached directly on the compose network, as a
// behandelaar would until the behandel-portal exists — S-12). The zaak is opened off the request // behandelaar would until the behandel-portal exists — S-12). The zaak is opened off the request
@@ -53,11 +56,12 @@ test('DigiD login → submit → public INGEDIEND → approve → public INGESCH
const approve = await request.post(`http://domain:8080/registrations/${reference}/approve`); const approve = await request.post(`http://domain:8080/registrations/${reference}/approve`);
expect(approve.status()).toBe(204); expect(approve.status()).toBe(204);
// The approval flows back to the projection; the openbaar register now shows it as INGESCHREVEN. // The approval flows back to the projection; the openbaar register now shows *our* row (matched by
// its reference) as INGESCHREVEN.
await expect await expect
.poll(async () => { .poll(async () => {
await page.reload(); await page.reload();
return page.getByRole('cell', { name: 'INGESCHREVEN' }).count(); return page.getByRole('row', { name: reference }).getByRole('cell', { name: 'INGESCHREVEN' }).count();
}, { timeout: 30_000, intervals: [1_000, 2_000, 3_000, 5_000] }) }, { timeout: 30_000, intervals: [1_000, 2_000, 3_000, 5_000] })
.toBeGreaterThan(0); .toBeGreaterThan(0);
}); });