Skip to content

Commit d36da07

Browse files
docs: add backlog tasks 340.3–340.8
1 parent 1d94297 commit d36da07

6 files changed

Lines changed: 263 additions & 0 deletions
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
id: TASK-340.3
3+
title: Delete settings.spec.js duplicate tests already covered by Vitest
4+
status: In Progress
5+
assignee: []
6+
created_date: '2026-04-30 19:29'
7+
updated_date: '2026-04-30 19:30'
8+
labels:
9+
- testing
10+
- e2e
11+
- vitest
12+
dependencies: []
13+
parent_task_id: TASK-340
14+
priority: medium
15+
ordinal: 9500
16+
---
17+
18+
## Description
19+
20+
<!-- SECTION:DESCRIPTION:BEGIN -->
21+
Several test groups in `settings.spec.js` are pure store-state manipulation with no browser persistence check, and duplicate existing `__tests__/ui.store.test.js` coverage.
22+
23+
**Delete** (duplicates only — keep persistence-after-reload tests):
24+
- View mode group `:340-393` (5 tests) → `ui.store.test.js:355-394`
25+
- Sidebar width clamp `:444``ui.store.test.js:280-308`
26+
- Invalid section guard `:519``ui.store.test.js:582-606`
27+
- Sort-ignore defaults `:580-588` (2 tests) → `ui.store.test.js:608-622`
28+
29+
**Keep**:
30+
- All persistence-after-reload tests (`:48`, `:75`, `:96`, `:114`, `:136`, `:155`) — exercise real localStorage round-trip in browser
31+
- Theme DOM tests (`:197-292`) — assert real DOM class changes
32+
- Settings navigation (`:495`) — real click interactions
33+
- Log Export group (`:685-871`) — real UI flows
34+
- Sidebar Theme Styling (`:936-1048`) — visual regression guards
35+
36+
Critical file:
37+
- `app/frontend/tests/settings.spec.js`
38+
<!-- SECTION:DESCRIPTION:END -->
39+
40+
## Acceptance Criteria
41+
<!-- AC:BEGIN -->
42+
- [ ] #1 ~10 duplicate tests deleted from settings.spec.js
43+
- [ ] #2 All persistence-after-reload and DOM-interaction tests preserved
44+
- [ ] #3 npx vitest run green
45+
- [ ] #4 task test:e2e green
46+
<!-- AC:END -->
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
id: TASK-340.4
3+
title: Delete missing-tracks.spec.js existence-check tests
4+
status: In Progress
5+
assignee: []
6+
created_date: '2026-04-30 19:29'
7+
updated_date: '2026-04-30 19:30'
8+
labels:
9+
- testing
10+
- e2e
11+
dependencies: []
12+
parent_task_id: TASK-340
13+
priority: low
14+
ordinal: 10500
15+
---
16+
17+
## Description
18+
19+
<!-- SECTION:DESCRIPTION:BEGIN -->
20+
Four tests in `missing-tracks.spec.js` assert only that store methods exist (`typeof store.method === 'function'`). These have no place in Playwright — they are contract checks that belong in Vitest or are implied by the store's own tests.
21+
22+
**Delete**:
23+
- `missing-tracks.spec.js:256` "should have UI store with missingTrackPopover methods"
24+
- `missing-tracks.spec.js:408` "should have library store with missing track support"
25+
- `missing-tracks.spec.js:416` "should have UI store with missingTrackModal property"
26+
- `missing-tracks.spec.js:424` "should have closeMissingTrackModal method on UI store"
27+
28+
Rely on existing Vitest store tests to enforce these contracts.
29+
30+
Critical file:
31+
- `app/frontend/tests/missing-tracks.spec.js`
32+
<!-- SECTION:DESCRIPTION:END -->
33+
34+
## Acceptance Criteria
35+
<!-- AC:BEGIN -->
36+
- [ ] #1 4 existence-check tests deleted
37+
- [ ] #2 Remaining missing-tracks tests (popover, modal, playback interception) still green
38+
- [ ] #3 task test:e2e green
39+
<!-- AC:END -->
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
id: TASK-340.5
3+
title: Consolidate add-to-playlist-browsing.spec.js via parametrized tests
4+
status: In Progress
5+
assignee: []
6+
created_date: '2026-04-30 19:29'
7+
updated_date: '2026-04-30 19:30'
8+
labels:
9+
- testing
10+
- e2e
11+
dependencies: []
12+
parent_task_id: TASK-340
13+
priority: low
14+
ordinal: 11500
15+
---
16+
17+
## Description
18+
19+
<!-- SECTION:DESCRIPTION:BEGIN -->
20+
12 tests in `add-to-playlist-browsing.spec.js` repeat the same sequence — open context menu → hover "Add to Playlist" → assert submenu appears — across album view, track-in-album view, and artist view. Each test navigates to `/` and bootstraps the full page.
21+
22+
**Consolidate** to 3-4 parametrized tests using a `for (const variant of variants)` loop over `{view, selector, label}` tuples, using `test.describe.parallel` so variants still run in parallel. The setup (navigate, open menu) runs once per variant instead of per-assertion.
23+
24+
Target: reduce from 12 tests to ~4 parametrized ones covering the same matrix of behaviors.
25+
26+
Critical file:
27+
- `app/frontend/tests/add-to-playlist-browsing.spec.js`
28+
<!-- SECTION:DESCRIPTION:END -->
29+
30+
## Acceptance Criteria
31+
<!-- AC:BEGIN -->
32+
- [ ] #1 Tests consolidated to ~4 parametrized variants
33+
- [ ] #2 All view/interaction combinations still covered
34+
- [ ] #3 task test:e2e green
35+
<!-- AC:END -->
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
id: TASK-340.6
3+
title: Consolidate sidebar.spec.js small visual/state tests
4+
status: In Progress
5+
assignee: []
6+
created_date: '2026-04-30 19:29'
7+
updated_date: '2026-04-30 19:30'
8+
labels:
9+
- testing
10+
- e2e
11+
dependencies: []
12+
parent_task_id: TASK-340
13+
priority: low
14+
ordinal: 12500
15+
---
16+
17+
## Description
18+
19+
<!-- SECTION:DESCRIPTION:BEGIN -->
20+
`sidebar.spec.js` has 55 tests across 1120 LOC. Many are small single-assertion visual/state checks that each pay the full `page.goto('/')` + Alpine bootstrap cost.
21+
22+
**Consolidate** small isolated checks into composite tests:
23+
- "show icons", "show labels", "highlight active", "section icons" → merge into one "sidebar nav renders correctly" test with multiple assertions
24+
- Similar small groups in Playlists Section ("show header", "show create button", "show empty state") → one composite test
25+
26+
**Keep as-is**:
27+
- Multi-select and keyboard-delete tests (Playlist Multi-Select and Batch Delete group) — real complex interactions
28+
- Drag-and-drop tests
29+
- Collapse/expand tests with state assertions
30+
31+
Target: reduce sidebar.spec.js from 55 tests to ~35-40, cutting 3-5 redundant `page.goto` calls.
32+
33+
Critical file:
34+
- `app/frontend/tests/sidebar.spec.js`
35+
<!-- SECTION:DESCRIPTION:END -->
36+
37+
## Acceptance Criteria
38+
<!-- AC:BEGIN -->
39+
- [ ] #1 Small isolated visual checks consolidated
40+
- [ ] #2 Interaction-heavy tests (multi-select, drag, keyboard) preserved unchanged
41+
- [ ] #3 task test:e2e green
42+
<!-- AC:END -->
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
id: TASK-340.7
3+
title: Playwright config and fixture tuning for speed
4+
status: In Progress
5+
assignee: []
6+
created_date: '2026-04-30 19:29'
7+
updated_date: '2026-04-30 19:30'
8+
labels:
9+
- testing
10+
- e2e
11+
- performance
12+
- playwright
13+
dependencies: []
14+
parent_task_id: TASK-340
15+
priority: medium
16+
ordinal: 13500
17+
---
18+
19+
## Description
20+
21+
<!-- SECTION:DESCRIPTION:BEGIN -->
22+
Infrastructure changes to squeeze more performance out of the remaining Playwright tests.
23+
24+
**Worker count** (`app/frontend/playwright.config.js:35`):
25+
- Change from `process.env.CI ? 4 : undefined` to `process.env.CI ? 6 : 12`
26+
- 12 local: uses more M4 Max cores (16 total, was only using 8)
27+
- 6 CI: safe bump on M-series runners, less dev-server contention than 8
28+
29+
**Dev server** (`app/frontend/playwright.config.js:122-129`):
30+
- Switch `webServer.command` from `npm run dev` (Vite HMR dev server) to a production build + preview
31+
- Eliminates per-request Vite transform cost under 8-12 concurrent workers
32+
- Verify correct preview port matches `baseURL`; check `package.json` scripts for `preview` target
33+
34+
**Worker-scoped page fixture** (`app/frontend/tests/fixtures/helpers.js`):
35+
- Add a worker-scoped fixture that navigates once per worker and resets Alpine store state between tests via `page.evaluate` instead of full `page.goto('/')`
36+
- Migrate `library-search.spec.js` as proof-of-concept; if runtime improves, expand to other files
37+
38+
Critical files:
39+
- `app/frontend/playwright.config.js:35,122-129`
40+
- `app/frontend/tests/fixtures/helpers.js`
41+
- `app/frontend/package.json` (check `preview` script)
42+
- `taskfiles/deno.yml:120-127`
43+
<!-- SECTION:DESCRIPTION:END -->
44+
45+
## Acceptance Criteria
46+
<!-- AC:BEGIN -->
47+
- [ ] #1 Workers set to 12 local / 6 CI in playwright.config.js
48+
- [ ] #2 webServer uses production preview build
49+
- [ ] #3 Worker-scoped fixture implemented and tested on library-search.spec.js
50+
- [ ] #4 task test:e2e green with measurably lower runtime
51+
<!-- AC:END -->
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
id: TASK-340.8
3+
title: Verify cleanup targets and update testing docs
4+
status: In Progress
5+
assignee: []
6+
created_date: '2026-04-30 19:29'
7+
updated_date: '2026-04-30 19:30'
8+
labels:
9+
- testing
10+
- docs
11+
dependencies:
12+
- TASK-340.1
13+
- TASK-340.2
14+
- TASK-340.3
15+
- TASK-340.4
16+
- TASK-340.5
17+
- TASK-340.6
18+
- TASK-340.7
19+
parent_task_id: TASK-340
20+
priority: low
21+
ordinal: 14500
22+
---
23+
24+
## Description
25+
26+
<!-- SECTION:DESCRIPTION:BEGIN -->
27+
Final verification task after all sibling cleanup tasks (340.1–340.6) and config tuning (340.7) are complete.
28+
29+
**Verify**:
30+
- Run `task test:e2e` and confirm total test count ≤ 480 (was 566)
31+
- Confirm wall-clock runtime ≤ 60s on M4 Max local (was 84s)
32+
- Run `cd app/frontend && npx vitest run` and confirm green
33+
- Run `task lint && task format` and confirm clean
34+
- Run `cargo nextest run --workspace` to confirm no Rust regressions
35+
36+
**Document**:
37+
- Update `docs/testing.md` Test Boundaries section if it needs reinforcement (add explicit "do not use page.evaluate-only tests in Playwright" note with examples)
38+
- Note final test count and runtime in commit message for traceability
39+
40+
Critical file:
41+
- `docs/testing.md`
42+
<!-- SECTION:DESCRIPTION:END -->
43+
44+
## Acceptance Criteria
45+
<!-- AC:BEGIN -->
46+
- [ ] #1 task test:e2e count <= 480 and runtime <= 60s
47+
- [ ] #2 npx vitest run green
48+
- [ ] #3 task lint clean
49+
- [ ] #4 docs/testing.md updated if needed
50+
<!-- AC:END -->

0 commit comments

Comments
 (0)