🧪 Testing Standards
1. Playwright (E2E)
- Structure: Use
test.step('Step name', async () => { ... })for readable reports. - Selectors: Prefer
getByRole,getByText. Avoid XPath and CSS selectors where possible. - Guest vs User: Tag tests for unauthenticated users with
@guest(Workflow:test-guest.md). - Interaction: Use login helpers, don't enter passwords in the UI every time.
2. Vitest (Unit)
- Test business logic and hooks in isolation.
- Use
vi.mockto mock Supabase.
3. Creation Workflow
- Interview (Requirements Gathering) — establish what exactly we're testing.
- Implementation:
e2e/[feature].spec.ts. - Verification:
npx playwright test e2e/[feature].spec.ts.