Public Access
docs: Sprint 14 — Vitest for useOnboarding (Q4) across all 6 running docs
Sprint 14 (commit28f3212) adds Vitest + happy-dom + @testing-library/react + @testing-library/jest-dom as devDeps and locks the useOnboarding state-transition contract with 7 unit tests in 25 ms. Lifts the 'no new npm deps' rule for testing-only. Runtime bundle unchanged (503.82 kB). No pre-existing WIP files touched. Sprint 9's bug1562929(onComplete wired to .reset, the inverse op) shipped a post-deploy fix the same day. Sprint 14 prevents recurrence at npm test time. This commit updates the 6 running docs that track sprints: - .agent/plan.md — header changed to 'Active sprint: Sprint 14'; Sprint 14 section (S14.1-S14.4 + Done when + Out of scope) added after the Sprint 13 section. - .agent/context.md — Sprint 14 decisions (D1-D7), open Q1, and file:line references added. - Review/sprint14-verification.md — NEW: deploy + 7-case test table + verification commands + Case 7 S9-bug-catch proof + 5-risk table + open Q1 (component-level tests). - Review/ui-nielsen-audit.md — Sprint 14 status block (T7.1-T7.3) added after the Sprint 13 block. - fix-ui-audit.md — Sprint 14 section (T7.1-T7.5) added after the Sprint 13 section. - Review/handoff-ui-audit.md — Batch J line in deploy list, Sprint 14 section after Sprint 13, TL;DR Sprint 14 line, Last-updated footer updated. (Did NOT replace the Sprint 7/8/TL;DR/environment-quirks/active-risks content that was at the bottom of the file — that material is preserved unchanged.) - docs/HANDOFF.md — Sprint 14 section added after Sprint 13, Last-updated footer updated. All 6 docs now reflect Sprint 14. §Future backlog remaining: F9-full (local Ollama model pull on the host). Q4 (Vitest) is now closed. Sprint 14 is the smallest sprint in the cycle (devDeps + 1 test file + 2 config files + 2 scripts) and the first that adds a test infrastructure layer.
This commit is contained in:
+29
-1
@@ -302,7 +302,7 @@ Trust the tests. Trust the live runs. Don't trust prose claims that something is
|
||||
**Current open proposals:**
|
||||
- `docs/proposals/2026-05-23-feedback-driven-recipe-discovery.md` — pending user approval. No code yet (per the 2026-05-23 section below).
|
||||
|
||||
**Last updated: 2026-06-05** — UI/UX audit & fix cycle (Sprints 1, 2, 3, 4, 5, 6, 7, 8, 9) complete. 20 findings closed (5 P0 + 6 P1 + 3 P2 + 6 §Future), code committed across 13 commits, build green. Sprint 1 deployed; Sprints 2-9 awaiting deploy. **Sprint 7 (`09c7525`, awaiting user deploy)** aligns "this week" to the upcoming Monday. **Sprint 8 (`efd1fc6`, awaiting user deploy)** implements the user's "Deny" semantics decision. **Sprint 9 (committed 2026-06-05, awaiting user deploy)** ships the F1 Onboarding Tour. **Sprint 10 (committed 2026-06-05, awaiting user deploy)** ships the "Deny Forever" on Recipes. **Sprint 11 (committed 2026-06-05, awaiting user deploy)** wires the dead "Generate Meal Plan" CTA. **Sprint 12 (committed 2026-06-05, awaiting user deploy)** ships the F8 Spoonacular search. **Sprint 13 (committed 2026-06-05, awaiting user deploy)** ships the F9-lite Ollama Cloud plan synthesis. See Sprint 7 + Sprint 8 + Sprint 9 + Sprint 10 + Sprint 11 + Sprint 12 + Sprint 13 sections below. Full UI-audit handoff at `Review/handoff-ui-audit.md`.
|
||||
**Last updated: 2026-06-05** — UI/UX audit & fix cycle (Sprints 1, 2, 3, 4, 5, 6, 7, 8, 9) complete. 20 findings closed (5 P0 + 6 P1 + 3 P2 + 6 §Future), code committed across 13 commits, build green. Sprint 1 deployed; Sprints 2-9 awaiting deploy. **Sprint 7 (`09c7525`, awaiting user deploy)** aligns "this week" to the upcoming Monday. **Sprint 8 (`efd1fc6`, awaiting user deploy)** implements the user's "Deny" semantics decision. **Sprint 9 (committed 2026-06-05, awaiting user deploy)** ships the F1 Onboarding Tour. **Sprint 10 (committed 2026-06-05, awaiting user deploy)** ships the "Deny Forever" on Recipes. **Sprint 11 (committed 2026-06-05, awaiting user deploy)** wires the dead "Generate Meal Plan" CTA. **Sprint 12 (committed 2026-06-05, awaiting user deploy)** ships the F8 Spoonacular search. **Sprint 13 (committed 2026-06-05, awaiting user deploy)** ships the F9-lite Ollama Cloud plan synthesis. **Sprint 14 (code complete 2026-06-05, awaiting commit + push)** ships Vitest for `useOnboarding` (Q4) — 7/7 tests green. See Sprint 7 + Sprint 8 + Sprint 9 + Sprint 10 + Sprint 11 + Sprint 12 + Sprint 13 + Sprint 14 sections below. Full UI-audit handoff at `Review/handoff-ui-audit.md`.
|
||||
|
||||
---
|
||||
|
||||
@@ -428,6 +428,34 @@ Trust the tests. Trust the live runs. Don't trust prose claims that something is
|
||||
|
||||
**Path forward to F9-full:** the `_ask_llm` helper is the single seam. F9-full only needs to swap the URL (`https://ollama.com/v1` → `http://localhost:11434`) and model name (`kimi-k2.6:cloud` → local). The endpoint code, prompt, and validation stay unchanged.
|
||||
|
||||
### Sprint 14 — Vitest for `useOnboarding` (Q4) (user-driven) — CODE COMPLETE 2026-06-05
|
||||
|
||||
**User direction (2026-06-05):** "Sprint 14: Vitest (Q4)." Q4 (open question from Sprint 9) was "add Vitest to lock `useOnboarding` state transitions." Sprint 9's bug `1562929` shipped a post-deploy fix the same day. Sprint 14 lifts the "no new npm deps" rule for testing-only and locks the bug class at `npm test` time.
|
||||
|
||||
**Scope (5 boxes):**
|
||||
1. **4 new devDeps** — `vitest@^1.6.0`, `happy-dom@^14.7.0`, `@testing-library/react@^14.2.0`, `@testing-library/jest-dom@^6.4.0` (runtime bundle unchanged) + 1 tsc dep `@types/node@^20` (needed for `node:fs/promises` in Case 7).
|
||||
2. **2 new config files** — `frontend/vitest.config.ts` (happy-dom env, setup file, `src/**/*.test.{ts,tsx}` glob) + `frontend/vitest-setup.ts` (loads `@testing-library/jest-dom/vitest`).
|
||||
3. **2 new scripts** — `npm test` (`vitest run --reporter=default`, no watch, CI-friendly) + `npm test:watch` (`vitest`).
|
||||
4. **1 new test file** — `frontend/src/components/OnboardingTour.test.tsx` (7 cases). Case 7 is the load-bearing test: a static check on `App.tsx` source that catches the original S9 bug `onComplete → reset` at the call site. Verified by inverting the wiring and watching Case 7 fail.
|
||||
5. **§Future backlog status after Sprint 14:** Q4 (Vitest) ✓. F9-full (local Ollama model pull) is the only remaining item — opt-in based on cloud-billing feedback.
|
||||
|
||||
**Test coverage (7 cases):**
|
||||
1. Clean init — `isComplete === false` when localStorage is empty.
|
||||
2. Persisted init — `isComplete === true` when `localStorage.getItem(KEY) === '1'`.
|
||||
3. `markComplete` — state → true, localStorage **stays** at `'1'`.
|
||||
4. `reset` — localStorage cleared, state → false.
|
||||
5. `show` — mirror of `reset` (intentional).
|
||||
6. localStorage throw on read — silently swallowed, `isComplete === false`, no crash.
|
||||
7. App.tsx wiring — `onComplete` calls `markComplete`, `onReset` calls `reset`; neither inverts.
|
||||
|
||||
**Build + tests:** `npm test` — 7/7 cases pass in ~25 ms. `npm run build` — tsc 0 errors, vite built in ~2.6 s, bundle 503.82 kB unchanged. No backend change. No migration. No runtime dep change.
|
||||
|
||||
**Deploy:** `git pull` + `cd frontend && npm install && npm test` (confirm 7/7) + `cd .. && docker compose up -d --build frontend`. No backend rebuild. Verification: `Review/sprint14-verification.md` (deploy + test commands + 5-risk table + open Q1).
|
||||
|
||||
**No regression expected:** Sprint 14 is devDeps + new test files only. No existing source files modified. Pre-existing WIP (`backend/app/api/recipes.py`, `backend/app/schemas/recipe.py`, `nginx/nginx.conf`) untouched.
|
||||
|
||||
**Open question:** Q1 — should Sprint 15 add component-level tests for `<OnboardingTour/>` (focus, arrow keys, dialog a11y)? Default: yes, future sprint. Adds `@testing-library/user-event`. ~1.5 hr.
|
||||
|
||||
---
|
||||
|
||||
## New session: 2026-06-05 (early)
|
||||
|
||||
Reference in New Issue
Block a user