Decompose: Break down #28 into implementable work units #29

Closed
opened 2026-05-15 21:24:07 +00:00 by Mark · 0 comments
Owner

Decomposition of #28: [smoke-test] Test coverage review: 93 source files, 8 test files (8.6%)

This issue decomposes the parent feature into independently implementable phases.


P1: Test Infrastructure — install Vitest + React Testing Library, write vitest.config.ts, add npm scripts ('npm run test', CI-friendly), write a smoke test that imports App and renders (confirms infra works), update AGENTS.md with test commands.

Files: vitest.config.ts, src/setupTests.ts, package.json, AGENTS.md

P2: Utility & Hook Tests — test all pure utility functions in src/lib/ and src/utils/ (formatDate, validateEmail, crypto helpers), test custom hooks (useAuth, useVault, useMobile) with mock providers, aim for 100% coverage on these files since they're pure logic with zero UI complexity.

Files: src/lib/formatDate.ts, src/lib/validateEmail.ts, src/hooks/useAuth.ts, src/hooks/useVault.ts, src/hooks/useMobile.ts
Depends on: P1

P3: Core UI Component Tests — test shared UI primitives (src/components/ui/*: Button, Card, Input, Dialog) and auth flow components (AuthPage, LoginForm). These are the highest-traffic components and catch the most regressions.

Files: src/components/ui/button.tsx, src/components/ui/card.tsx, src/components/ui/input.tsx, src/components/AuthPage.tsx, src/components/LoginForm.tsx
Depends on: P1

P4: Feature Component Tests — test vault management components (VaultList, VaultDetail, VaultCard, FileUploader) and settings/profile pages. Use MSW or mock service layer to avoid real API calls.

Files: src/components/VaultList.tsx, src/components/VaultDetail.tsx, src/components/VaultCard.tsx, src/components/FileUploader.tsx, src/components/SettingsPage.tsx
Depends on: P3

P5: Backend Tests — set up Vitest in backend/ (or Jest if preferred), test Express route handlers, middleware (auth, rate-limit), and service layer. Mock Firestore/DynamoDB. Add CI config to run both frontend + backend test suites.

Files: backend/package.json, backend/vitest.config.ts, backend/src/routes/auth.ts, backend/src/routes/vaults.ts, backend/src/middleware/auth.ts
Depends on: P1

P6: Integration & Edge Cases — add integration tests for full auth flow (register → login → access vault), file encryption/decryption round-trip tests, error boundary tests, and any remaining untested source files to push coverage past 50%. Coverage threshold enforcement in CI.

Files: .github/workflows/test.yml, vitest.config.ts, src/App.tsx, src/ErrorBoundary.tsx
Depends on: P4, P5


Post-completion: When each phase is complete, comment on #28 with a summary of what was implemented.

## Decomposition of #28: [smoke-test] Test coverage review: 93 source files, 8 test files (8.6%) This issue decomposes the parent feature into independently implementable phases. --- ### P1: Test Infrastructure — install Vitest + React Testing Library, write vitest.config.ts, add npm scripts ('npm run test', CI-friendly), write a smoke test that imports App and renders (confirms infra works), update AGENTS.md with test commands. **Files:** vitest.config.ts, src/setupTests.ts, package.json, AGENTS.md ### P2: Utility & Hook Tests — test all pure utility functions in src/lib/ and src/utils/ (formatDate, validateEmail, crypto helpers), test custom hooks (useAuth, useVault, useMobile) with mock providers, aim for 100% coverage on these files since they're pure logic with zero UI complexity. **Files:** src/lib/formatDate.ts, src/lib/validateEmail.ts, src/hooks/useAuth.ts, src/hooks/useVault.ts, src/hooks/useMobile.ts **Depends on:** P1 ### P3: Core UI Component Tests — test shared UI primitives (src/components/ui/*: Button, Card, Input, Dialog) and auth flow components (AuthPage, LoginForm). These are the highest-traffic components and catch the most regressions. **Files:** src/components/ui/button.tsx, src/components/ui/card.tsx, src/components/ui/input.tsx, src/components/AuthPage.tsx, src/components/LoginForm.tsx **Depends on:** P1 ### P4: Feature Component Tests — test vault management components (VaultList, VaultDetail, VaultCard, FileUploader) and settings/profile pages. Use MSW or mock service layer to avoid real API calls. **Files:** src/components/VaultList.tsx, src/components/VaultDetail.tsx, src/components/VaultCard.tsx, src/components/FileUploader.tsx, src/components/SettingsPage.tsx **Depends on:** P3 ### P5: Backend Tests — set up Vitest in backend/ (or Jest if preferred), test Express route handlers, middleware (auth, rate-limit), and service layer. Mock Firestore/DynamoDB. Add CI config to run both frontend + backend test suites. **Files:** backend/package.json, backend/vitest.config.ts, backend/src/routes/auth.ts, backend/src/routes/vaults.ts, backend/src/middleware/auth.ts **Depends on:** P1 ### P6: Integration & Edge Cases — add integration tests for full auth flow (register → login → access vault), file encryption/decryption round-trip tests, error boundary tests, and any remaining untested source files to push coverage past 50%. Coverage threshold enforcement in CI. **Files:** .github/workflows/test.yml, vitest.config.ts, src/App.tsx, src/ErrorBoundary.tsx **Depends on:** P4, P5 --- **Post-completion:** When each phase is complete, comment on #28 with a summary of what was implemented.
Mark closed this issue 2026-05-17 21:11:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/subvault#29
No description provided.