refactor(shared): delete unwrapOk, the unadopted test value-object helper (RB-33)
unwrapOk had zero consumers in apps/ or libs/ since ADR-0006 shipped it. The one call site the finding named already satisfies the ADR's real rule (call the real parser, never a cast) with an inline guard, so adding a manufactured first caller was not the better fix. This commit deletes the helper and its file, and updates the one doc sentence that named it. The finding's call site is unchanged. See rb-33.md for the full adopt-or-delete reasoning. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -89,11 +89,11 @@ can only ever be a state the real reducer actually produces:
|
||||
const atStep3 = givenIntake(Start(), SetUren('1200'), Next(), SetDiplomaHerkomst('NL'), Next());
|
||||
```
|
||||
|
||||
The same rule extends to value objects (`unwrapOk(parseX(raw))` instead of a cast) and to
|
||||
`RemoteData` (`loading()` / `success(v)` / `failure(e)` in
|
||||
`libs/shared/src/testing/{value-object,remote-data}.ts` instead of a redefined-per-file
|
||||
literal). **Never** a `.withX().withY()` builder over an open constructor — that just
|
||||
re-opens whatever illegal state the domain closed.
|
||||
The same rule extends to value objects — call the real `parse*` and check `.ok` before use,
|
||||
never a cast — and to `RemoteData` (`loading()` / `success(v)` / `failure(e)` in
|
||||
`libs/shared/src/testing/remote-data.ts` instead of a redefined-per-file literal). **Never**
|
||||
a `.withX().withY()` builder over an open constructor — that just re-opens whatever illegal
|
||||
state the domain closed.
|
||||
|
||||
## UI = Storybook, not heavy component tests
|
||||
|
||||
|
||||
Reference in New Issue
Block a user