This checklist helps track the migration from the old testing patterns to the new improved infrastructure.Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Completed ✅
- Created unified
TestProviderswrapper (tests/utils/providers.tsx) - Created module-specific cleanup utilities (
tests/utils/cleanup/) - Updated
UNIT_TEST_TEMPLATE.tsto use new TestProviders wrapper - Fixed Playwright
baseURLmismatch (8080 → 4173) - Created test organization standards documentation
- Updated test generator agent with new patterns
Manual Configuration Updates Required ⚠️
These files are protected by security hooks and require manual updates:1. package.json - Add E2E Test Scripts
Location: After "test:rls" line
Add:
2. vitest.config.ts - Enable Parallel Execution
Change:
3. vitest.config.ts - Increase Coverage Thresholds
Change:
Test Migration Tasks
Phase 1: Update Hook Tests (155+ tests)
- Identify all hook tests using manual QueryClient setup
- Update to use
wrapperfrom@/tests/utils/providers - Verify tests still pass
- Update test files in batches:
-
tests/unit/directory -
tests/integration/directory - Co-located tests in
src/__tests__/
-
Phase 2: Update Component Tests
- Identify component tests using manual provider setup
- Update to use
TestProvidersfrom@/tests/utils/providers - Verify tests still pass
Phase 3: Refactor tests/setup.ts
- Import cleanup utilities:
import { cleanupAllTestData } from '@/tests/utils/cleanup'; - Replace monolithic cleanup function with module-specific cleanup
- Verify cleanup still works correctly
- Reduce file size from 894 lines to <200 lines
Phase 4: Standardize Test Organization
- Review RLS test organization (some in subdirectories, some flat)
- Move all RLS tests to flat
tests/rls/structure - Ensure all RLS tests follow
{core}-{table}.rls.test.tsnaming - Verify module organization in
tests/unit/,tests/integration/,tests/e2e/
Phase 5: Fix Failing Tests
- Run full test suite:
npm test - Identify and fix 479 currently failing tests
- Address QueryClient provider failures (should be fixed by Phase 1)
- Reduce skipped tests from 2,310 (43%) to <5%
Verification Steps
After each phase:-
Run Tests:
-
Check Coverage:
-
Verify No Regressions:
- Compare pass rates before/after
- Ensure no new failures introduced
- Verify cleanup still works
Success Criteria
- All hook tests use
wrapperfrom@/tests/utils/providers - All component tests use
TestProviderswrapper -
tests/setup.tsis <200 lines - Test skip rate <5% (currently 43%)
- Test pass rate >95% (currently 84.5%)
- Coverage thresholds at 40% (currently 15-20%)
- All tests follow naming conventions
- Test organization is consistent across all types
Resources
Notes
- Some files (
package.json,vitest.config.ts) are protected by security hooks - Manual updates required for these files
- Test migration can be done incrementally
- Focus on high-impact changes first (QueryClient wrapper fixes)