Skip to content

Commit 73ee31d

Browse files
committed
docs(mosaic): make feature tests the default, not the only option
1 parent e1b22c9 commit 73ee31d

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎.claude/skills/mosaic/references/testing.md‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,17 @@ Rule of thumb: **test each behavior once, at the boundary that owns it.**
3333
Visual states (loading, empty, every error, every variant) are swingset stories
3434
with plain props, reviewed by eye. Don't duplicate them as view tests.
3535

36-
Do **not** add per-layer model, controller, view, or wrapper tests with mocked
37-
layers. If a behavior is visible to the user, the feature test owns it. Some
38-
features still carry per-layer tests from before this rule; delete them once a
39-
feature test covers the same behavior.
36+
Default to a feature test for behavior the user can see. Reach for a smaller
37+
test when it is the better tool, for example:
38+
39+
- Logic with many combinations (ordering, labels, layout rules). Pull it into
40+
a pure function and unit-test the table.
41+
- States or timing that are awkward to produce through FAPI.
42+
- A bug that is much easier to pin down at a single layer.
43+
44+
Avoid per-layer tests with mocked layers that repeat what a feature test
45+
already covers. Older per-layer tests like that can go once a feature test
46+
covers the same behavior.
4047

4148
## Running
4249

0 commit comments

Comments
 (0)