test: add Vitest and unit tests for the mosaic domain model #7
Loading…
Reference in a new issue
No description provided.
Delete branch "add-vitest-domain-model-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
npm testscriptvitest.config.ts(node environment), kept separate fromvite.config.tssince that config is tuned for the Tauri/browser build and not needed for Node-only unit testssrc/Mosaic.test.ts— 14 tests covering every requirement inopenspec/specs/mosaic-domain-model/spec.md: row/column numbering, alternating-color/locked-edge construction, cell-toggle validity, written-pattern text formatting, and save/load round-trippingopenspec/changes/archive/2026-09-19-add-vitest-domain-model-tests/) with proposal, design, and tasks —skip_specs: truesince this is tooling, not an app-behavior changeNotable finding while implementing
The initial design assumed non-toggle tests could construct
new MosaicChart(...)directly. That's not possible —MosaicChart/MosaicRow/MosaicCellaren't exported at all — so every test drives the domain model throughmosaic.initialize(...)andmosaic.datainstead. Corrected in the change'sdesign.mdbefore writing tests.Out of scope (deferred)
dialogs-bridge.tstests (would need Tauri/Jimp/pdfkit mocking)Test plan
npm test— 14/14 passingnpm run lint— 0 errors, including the new filesnpx tsc --noEmit— cleannpx vite build— still succeeds🤖 Generated with Claude Code
https://claude.ai/code/session_01KoLHnQugaAW2eknKo8FxVp