test(frontend): replay real messages instead of hand-built state literals (WP-70)
Every machine spec redefined its own throwaway fixture helper (editing1/2/3,
editingWith), hardcoding fields like errors: {} that assert against shapes
the reducer may never actually produce. given(reduce, initial)(...msgs)
(libs/shared/src/testing/machine.ts) replaces them by replaying real Msgs
through the real reduce, so a fixture is provably reachable. Adds the same
idiom for value objects (unwrapOk) and RemoteData (loading/success/failure),
plus intake.acceptance.spec.ts as a worked full-journey example.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -108,6 +108,7 @@
|
||||
"**/contracts/**",
|
||||
"libs/shared/src/infrastructure/api-client.ts",
|
||||
"apps/ssp/src/main.ts",
|
||||
"**/*.testing.ts",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -236,6 +237,7 @@
|
||||
"**/contracts/**",
|
||||
"libs/shared/src/infrastructure/api-client.ts",
|
||||
"apps/behandelportal/src/main.ts",
|
||||
"**/*.testing.ts",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -293,6 +295,7 @@
|
||||
"**/contracts/**",
|
||||
"src/infrastructure/api-client.ts",
|
||||
"src/test-entry.ts",
|
||||
"**/*.testing.ts",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -330,6 +333,7 @@
|
||||
"**/*.stories.ts",
|
||||
"**/contracts/**",
|
||||
"src/test-entry.ts",
|
||||
"**/*.testing.ts",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user