File tree Expand file tree Collapse file tree
.claude/skills/mosaic/references Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,10 +33,17 @@ Rule of thumb: **test each behavior once, at the boundary that owns it.**
3333Visual states (loading, empty, every error, every variant) are swingset stories
3434with 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
You can’t perform that action at this time.
0 commit comments