test(backend): split RuleTests.cs by aggregate, refresh DDD doc (WP-71)

RuleTests.cs held five aggregates' rules as nested classes in one file,
misaligned with Domain/<Aggregate>/ and with the Acceptance/Builders/
folder convention WP-70 started. Split into Domain/<Aggregate>RuleTests.cs
(pure move — same names, same bodies, same count) plus a new
ApplicationRuleTests.cs (the enum invariant moved out of the
WebApplicationFactory-booting ApplicationTests.cs, since it's a pure
Enum.GetNames check with no business needing a web host) and
OrgTemplateRuleTests.cs (RejectDraft had no direct unit test before,
only endpoint coverage).

libs/shared/docs/layers.mdx still taught the pre-WP-67 shape (six
contexts, no apps/libs split, enforcement via ESLint) — updated to the
real monorepo structure and to dependency-cruiser as the actual
enforcement mechanism. Adds specs for registration.policy.ts's
isStatusConsistent (untested; its backend mirror is) and both apps'
auth/domain/session.ts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
eho
2026-08-18 20:25:05 +02:00
co-authored by Claude Sonnet 5
parent b937e55ad3
commit 28c0a250e7
13 changed files with 409 additions and 254 deletions
@@ -10,6 +10,14 @@ import { IntakeState } from '@herregistratie/domain/intake.machine';
// wrapping is dropped, the inputs revert to bare white. The buitenland step with
// buitenlandGewerkt='ja' has two groups (the question + the land/uren follow-up), so it
// must render ≥2 fieldsets, each holding a form-group.
//
// SANCTIONED TestBed exception (CLAUDE.md "Testing": UI is normally exercised via Storybook,
// not heavy component tests): this pins the *count and nesting* of rendered DOM nodes for a
// specific machine state (2+ <fieldset> wrappers, each containing a .form-group), which is a
// structural/visual regression, not an accessibility one — a Storybook a11y (axe) run checks
// for accessibility violations on whatever markup is rendered, it does not assert that the
// markup takes this particular shape, so it would not catch the grouping silently collapsing
// back to bare inputs.
const buitenlandJa: IntakeState = {
tag: 'Answering',
answers: { buitenlandGewerkt: 'ja' },