refactor(web): set up component test infra + decompose ProjectWizard

Phase 4a: Add @testing-library/react, user-event, jest-dom, jsdom.
Switch vitest environment to jsdom, add setup file, create test-utils
with QueryClient wrapper.

Phase 4b: Extract ProjectWizard form logic into project-wizard/ subdir:
- types.ts: WizardState, Assignment, constants, factory functions
- useProjectWizardForm.ts: form state hook + canGoNext pure function

Phase 4c: 32 tests for canGoNext validation (all 5 steps), makeDefaultState,
and makeReq factory function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-10 17:00:45 +02:00
parent 2f2fe2631f
commit 63db4a09e6
10 changed files with 1350 additions and 349 deletions
+4
View File
@@ -52,6 +52,9 @@
"@capakraken/eslint-config": "workspace:*",
"@capakraken/tsconfig": "workspace:*",
"@playwright/test": "^1.49.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/dompurify": "^3.2.0",
"@types/node": "^22.10.2",
"@types/react": "^19.0.6",
@@ -61,6 +64,7 @@
"@vitest/coverage-v8": "^2.1.9",
"autoprefixer": "^10.4.20",
"eslint": "^10.2.0",
"jsdom": "^29.0.2",
"postcss": "^8.4.49",
"tailwindcss": "^3.4.17",
"typescript": "^5.6.3",