Vitest Browser Testing
Use this skill for browser-mode tests that should assert public behavior through real DOM queries and user interactions.
Required References
Before writing or reviewing Vitest Browser tests, read:
references/behavior-testing.mdreferences/vitest-browser-testing.md
Workflow
- Match the local project's Vitest Browser import style and render helper.
- Query through
pageby role, label, text, value, or placeholder before using test IDs. - Drive behavior through
userEventor public browser interactions. - Assert DOM state with
await expect.element(...)and async side effects withexpect.poll(...). - Reject selectors, classes, SVG internals, and internal data attributes unless they are documented public contracts.