Skip to content

Commit 99abfb7

Browse files
test(e2e): remove redundant Playwright specs covered by Vitest (TASK-321)
Remove 4 Playwright spec files and reduce queue.spec.js from 38 to 5 tests. Removed specs tested store logic already covered by Vitest unit/property tests or checked trivial CSS values. Deleted: stores.spec.js, library-column-padding.spec.js, text-selection.spec.js, browsing-track-sorting.spec.js. Kept 5 queue.spec.js tests that exercise real user interactions (double-click, next/prev, shuffle toggle, context menu). Add test boundary guidelines to AGENTS.md and docs/testing.md to prevent future Playwright/Vitest duplication. Add backlog tasks for phases 2-3 of CI pipeline optimization. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 67f382f commit 99abfb7

11 files changed

Lines changed: 279 additions & 3081 deletions

AGENTS.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,30 @@ actionlint # Lint all workflows
165165
- **After changing frontend code**: `cd app/frontend && npx vitest run`
166166
- **After changing Rust code**: `cargo nextest run --workspace`
167167

168+
## Test Boundaries
169+
170+
Each test layer has a clear responsibility. Do NOT write a Playwright E2E test for something that belongs in Vitest or Rust tests.
171+
172+
| What to test | Where | Why |
173+
|---|---|---|
174+
| Store logic (queue, player, library mutations) | Vitest `__tests__/` | Fast, isolated, supports property-based testing |
175+
| Pure functions (sorting, filtering, formatting) | Vitest `__tests__/` | No DOM needed |
176+
| CSS details (padding, user-select, computed styles) | Nowhere (design review) | Brittle, low value |
177+
| User interaction flows (click, drag, context menu) | Playwright `tests/` | Needs real browser |
178+
| Cross-component integration (play track -> queue updates -> Now Playing renders) | Playwright `tests/` | Tests wiring between components |
179+
| Backend logic (audio, DB, concurrency) | Rust `#[test]` / proptest | Must run in Rust |
180+
181+
**Rules:**
182+
- Playwright tests MUST involve real user interactions (clicks, keyboard, drag). If a test only calls `page.evaluate()` to manipulate Alpine stores, it belongs in Vitest.
183+
- Never duplicate store logic tests between Playwright and Vitest. Vitest is authoritative for store behavior.
184+
- Tag Playwright tests that need the Tauri runtime with `@tauri`. Default CI mode (`fast`) skips these.
185+
168186
## Implementation Notes
169187

170188
1. **Components**: Modular, single-responsibility. Use Alpine.js for interactivity, basecoat/Tailwind for styling.
171189
2. **IPC**: All backend operations via Tauri commands. Use async/await. Emit events for real-time updates.
172190
3. **File Organization**: Frontend in `app/frontend/`, backend in `src-tauri/src/`. Keep files under 500 LOC.
173-
4. **Testing**: Unit tests + Playwright E2E. All integration tests MUST use Playwright.
191+
4. **Testing**: See [Test Boundaries](#test-boundaries) above and [Testing Guide](docs/testing.md) for the full decision framework.
174192
5. **Code Style**: `deno lint` + `deno fmt` (frontend), `cargo fmt` + `cargo clippy` (backend). Run formatters before committing.
175193

176194
<!-- BACKLOG.MD MCP GUIDELINES START -->

0 commit comments

Comments
 (0)