diff --git a/tests/e2e/registration.spec.ts b/tests/e2e/registration.spec.ts index 3313bdc..c6395ff 100644 --- a/tests/e2e/registration.spec.ts +++ b/tests/e2e/registration.spec.ts @@ -66,7 +66,16 @@ test('DigiD submit → public INGEDIEND → behandelaar goedkeurt → public ING }, { timeout: 30_000, intervals: [1_000, 2_000, 3_000, 5_000] }) .toBeGreaterThan(0); + // Click and wait for the decide POST to finish (204) BEFORE leaving the page. `click()` only + // dispatches the request; navigating away immediately cancels it in flight (nginx logs a 499) and + // the decision never reaches the domain — so the registration would stay INGEDIEND. + const decided = page.waitForResponse( + (r) => + r.url().includes(`/behandel/registrations/${reference}/decide`) && + r.request().method() === 'POST', + ); await goedkeuren.click(); + expect((await decided).status()).toBe(204); // The approval flows back to the projection; back on the openbaar register *our* row (matched by // its reference) now shows INGESCHREVEN.