5d5b23894c
- LoadingState.test.tsx: default/custom message rendering - ErrorState.test.tsx: message, retry button, callback - FileBrowser.test.tsx: loading, entries, error states - ToolTypesTab.test.tsx: loading, content, error states - SessionCard.test.tsx: active/recent variants, unnamed fallback - CreateSessionForm.test.tsx: render, validation, repo loading - Fix vite.config.ts resolve.alias for @/ path mapping in tests Quality gates: vitest 17 new tests pass, 70/74 total pass (pre-existing 4 failures in projects.test.tsx unrelated) Refs: repo-restructure Task 5.1
1.5 KiB
1.5 KiB
Task 5.1 Apply Report: Add Tests for Extracted Components
Status: Success
Files Created (6)
apps/web/src/components/ui/LoadingState.test.tsx— 2 tests: default message, custom messageapps/web/src/components/ui/ErrorState.test.tsx— 3 tests: message render, no retry button, retry callbackapps/web/src/components/features/git/FileBrowser.test.tsx— 3 tests: loading state, file entries after load, error stateapps/web/src/components/features/tool-workshop/ToolTypesTab.test.tsx— 3 tests: loading state, heading after load, error stateapps/web/src/components/features/session/SessionCard.test.tsx— 3 tests: active variant, recent variant, unnamed fallbackapps/web/src/components/features/session/CreateSessionForm.test.tsx— 3 tests: form render, validation error, repository loading
Files Modified (1)
apps/web/vite.config.ts— Addedresolve.aliasfor@/path mapping to support test file imports
Quality Gate Results
| Gate | Result |
|---|---|
| New tests (6 files) | ✅ 17 passed |
| Full test suite | ✅ 70 passed / 74 total |
| Pre-existing failures | 4 tests in projects.test.tsx (React Router context issue — pre-existing, unrelated) |
| Typecheck | ✅ PASS |
| Lint | ✅ PASS |
Notes
- All tests use Vitest + React Testing Library (jsdom environment)
- API calls mocked with
vi.mock()andvi.fn() MemoryRouterused for components withuseSearchParams- No test file exceeds 200 lines
- No existing tests were broken by changes