Repository navigation
No automated tests for frontend behaviour #339
Description
Problem
CI runs exactly one check on the frontend:
- run: for f in static/js/*.js; do node --check "$f"; doneThat is a syntax parse. Any behavioural regression in static/js/ ships unnoticed until a user reports it.
The backend has real coverage (tests/test_*.py, pytest with asyncio_mode = auto, registry isolation fixtures). The frontend, which is where the whole UI lives, has none.
Evidence this is costing us
#335 is the direct case. "Export All Stems" became permanently unclickable after a single export, for every song, until the app restarted. It shipped in alpha 15 and was found by a user, not by us.
It was also only reproducible in the desktop build: in a browser the synthetic <a>.click() closes the chip panel before the busy state is applied, so the bug hides. Nothing in CI runs the desktop code path.
#337 fixed it and found three more defects in the same state machine while doing so:
- "Exporting..." shown for a download that never started
- The busy state resetting on a fixed timer rather than real completion, making a failed save indistinguishable from a successful one
- Export failures offering a "Try again" button that sent the user to the URL import field
All four were caught by hand-written Playwright scripts in a scratchpad directory. Those scripts are now gone. The next person to touch the export menu starts from zero, and none of these four regressions would be caught if reintroduced.
What is needed
A minimal browser-driven test setup, not a full framework:
- Playwright as a dev dependency, headless Chromium.
- A fixture that boots the FastAPI app and seeds a completed job, so tests run against real endpoints rather than mocks.
- A way to exercise the Tauri branch, which matters because the desktop and browser paths genuinely diverge. Stubbing
window.__TAURI__.core.invokeviaaddInitScriptis enough and is what was used to find [Bug]: Unable to export stems again after exporting stems without restarting the program #335. - A CI job that runs it.
Worth covering first, in rough order of how much they have already cost:
- Export menu state: every row re-enabled after every export, in both host modes
- Export failure handling: error surfaces, state recovers, no stuck busy
- Format switching, particularly MP4 hiding and restoring the audio-only rows
- Beat grid editor interactions
- Playback and transport basics
Note on scope
This is deliberately filed as its own issue rather than being bolted onto #337. Adding test infrastructure is a bigger decision than a bug fix, and it should not be made as a side effect of one.
Activity
test(frontend): add browser tests, starting with the export menu (ste…