Files
register-referentie/tests/e2e/default-fill.spec.ts
T
notandClaude Opus 5 30c5279e90 test(infra): medewerker login must be refused without a second factor (refs #132)
The keycloak smoke check now asserts that a password-only grant on the medewerker
realm is rejected and that a TOTP code completes it. The e2e medewerker logins move
to a shared helper that submits Keycloak's OTP challenge. Both fail against the
current realm export, which enforces no MFA.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 09:07:45 +02:00

26 lines
1.2 KiB
TypeScript

import { expect, test } from '@playwright/test';
import { loginMedewerker } from './medewerker-login';
// S-15b: a beheerder edits the ACL default-fill in the beheer portal and gets a saved confirmation.
// Runs against the shared verify stack; it edits + saves (the ACL store is in-memory, ADR-0026) and
// asserts the confirmation, without depending on another test's state.
test('a beheerder edits and saves the default-fill', async ({ page }) => {
await page.goto('http://beheer/');
// Keycloak medewerker-realm login (same realm as behandel) — password + enforced TOTP.
await loginMedewerker(page, 'bram-beheerder');
await expect(page.getByRole('heading', { name: /Catalogus/i })).toBeVisible();
// Navigate to the default-fill editor and change a value.
await page.getByRole('link', { name: /Default-fill/i }).click();
await expect(page.getByRole('heading', { name: /Default-fill/i })).toBeVisible();
const bron = page.getByLabel('Bronorganisatie');
await expect(bron).toBeVisible();
await bron.fill('517439943');
await page.getByRole('button', { name: /Opslaan/i }).click();
await expect(page.getByText(/standaardwaarden zijn opgeslagen/i)).toBeVisible();
});