--- phase: 03-wizard-ui plan: "01" subsystem: testing tags: [vitest, jsdom, react, tdd, test-infrastructure] # Dependency graph requires: - phase: 01-foundation provides: WizardState/WizardAction types, useWizard/WizardProvider context, BackendType - phase: 02-generators provides: rclone config generation (tested separately, provides context for what forms must produce) provides: - Vitest jsdom environment configured in vite.config.ts - Wave 0 RED baseline: 26 failing test stubs covering WIZD-01, WIZD-02, WIZD-03, WIZD-04, BACK-01, BACK-02, BACK-03 - src/components/wizard/ directory scaffolded affects: - 03-02-PLAN (BackendSelectionStep implementation drives stubs to GREEN) - 03-03-PLAN (RemoteConfigStep implementation) - 03-04-PLAN (StepIndicator implementation) - 03-05-PLAN (App step routing) # Tech tracking tech-stack: added: [] patterns: - Wave 0 TDD: stubs written with expect.fail before any component files exist - Per-file jsdom directive via // @vitest-environment jsdom comments - Test names include requirement IDs (WIZD-xx, BACK-xx) for traceability key-files: created: - src/App.test.tsx - src/components/wizard/BackendSelectionStep.test.tsx - src/components/wizard/RemoteConfigStep.test.tsx - src/components/wizard/StepIndicator.test.tsx modified: - vite.config.ts key-decisions: - "jsdom environment added to vite.config.ts test block — no /// needed with vitest ^4.x" - "Wave 0 stubs use expect.fail('not yet implemented') — gives named RED failures, cleaner than import errors" - "Test names embed requirement IDs (WIZD-01, BACK-02, etc.) — traceability without external matrix" patterns-established: - "Wave 0 TDD: create failing test stubs before component files exist — RED baseline before any implementation" - "Requirement traceability in test names: describe block names include requirement ID (e.g., 'WIZD-01: backend card grid')" requirements-completed: [WIZD-01, WIZD-02, WIZD-03, WIZD-04, BACK-01, BACK-02, BACK-03] # Metrics duration: 1min completed: 2026-03-27 --- # Phase 3 Plan 01: Test Infrastructure and Wave 0 RED Baseline Summary **Vitest jsdom configured and 26 RED test stubs created covering all 7 Phase 3 requirements (WIZD-01 through WIZD-04, BACK-01 through BACK-03)** ## Performance - **Duration:** 1 min - **Started:** 2026-03-27T09:24:50Z - **Completed:** 2026-03-27T09:26:26Z - **Tasks:** 2 - **Files modified:** 5 ## Accomplishments - Configured vite.config.ts with `test: { environment: 'jsdom', passWithNoTests: true }` — React component tests can now run in jsdom without "document is not defined" errors - Created `src/components/wizard/` directory and 4 test stub files covering all 7 Phase 3 requirements - 26 tests fail RED with descriptive "not yet implemented" messages, establishing the baseline Plans 03-02 through 03-05 will drive to GREEN ## Task Commits Each task was committed atomically: 1. **Task 1: Configure Vitest jsdom environment** - `9eef937` (chore) 2. **Task 2: Create Wave 0 test stubs RED baseline** - `153bc61` (test) ## Files Created/Modified - `vite.config.ts` - Added `test: { environment: 'jsdom', passWithNoTests: true }` block - `src/App.test.tsx` - 3 stubs for WIZD-02 step routing - `src/components/wizard/BackendSelectionStep.test.tsx` - 10 stubs for WIZD-01 (card grid) and WIZD-04 (remote name validation) - `src/components/wizard/RemoteConfigStep.test.tsx` - 8 stubs for BACK-01 (Azure Blob), BACK-02 (S3), BACK-03 (S3-Compatible) - `src/components/wizard/StepIndicator.test.tsx` - 5 stubs for WIZD-03 (back navigation preserves state) ## Decisions Made - No `/// ` needed with vitest ^4.x when using `test` inside `defineConfig` — plan explicitly noted this to avoid a common mistake - `expect.fail('not yet implemented')` chosen over import-error approach for RED state — gives named test failures rather than file-level errors, cleaner output for Plans 03-02 through 03-05 to work against - Requirement IDs embedded in describe block names for direct traceability without a separate matrix ## Deviations from Plan None - plan executed exactly as written. ## Issues Encountered None. ## User Setup Required None - no external service configuration required. ## Next Phase Readiness - Test infrastructure is ready; Plans 03-02 through 03-05 can implement components and drive tests to GREEN - 26 failing tests provide the complete RED baseline: each plan knows exactly which stubs it must satisfy - No blockers --- *Phase: 03-wizard-ui* *Completed: 2026-03-27*