You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/ha-frontend-testing/SKILL.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,12 +49,13 @@ Do not pass `--help`, `--background`, or `--modern` to `script/build_frontend`;
49
49
50
50
Managed app, demo, gallery, and E2E app workflows share one lifetime lock, so only one build or development server can run at a time.
51
51
52
-
## Unit And Utility Tests
52
+
## When To Add Tests
53
53
54
-
- Add or update Vitest tests for data processing, utility code, and behavior that can be tested without a browser.
55
-
- Mock WebSocket connections and API calls at boundaries.
56
-
- Cover loading, error, unavailable, and missing-entity states where relevant.
57
-
- Test accessibility-sensitive behavior when it can be asserted without brittle DOM internals.
54
+
- Write tests for code that computes something: data processing, utility functions, config validation, and what happens when the user interacts with a component.
55
+
- Do not write tests that check what a component looks like: its text, CSS classes, styles, or slots. Do not write tests that check the default value of an option.
56
+
- A component that only takes data from contexts and helpers and puts it in a template does not need a test.
57
+
- If you are not sure a test is useful, describe the test and what it would catch, and let the user decide.
58
+
- Tests never talk to a real Home Assistant. Replace `callWS`, `callApi`, and the connection with fakes.
0 commit comments