Some checks failed
Backend API CI / test-unit (push) Has been cancelled
Backend API CI / test-integration (push) Has been cancelled
Veza CI / Rust (Stream Server) (push) Has been cancelled
Veza CI / Backend (Go) (push) Has been cancelled
Veza CI / Notify on failure (push) Has been cancelled
Veza CI / Frontend (Web) (push) Has been cancelled
Frontend CI / test (push) Has been cancelled
Security Scan / Secret Scanning (gitleaks) (push) Has been cancelled
First-attempt commit02728909fonly captured the .gitignore change; the pre-commit hook silently dropped the 343 staged moves/deletes during lint-staged's "no matching task" path. This commit re-applies the intended J1 content on top of24af2f72b(which was pushed in parallel). Uses --no-verify because: - J1 only touches .md/.json/.log/.png/binaries — zero code that would benefit from lint-staged, typecheck, or vitest - The hook demonstrated it corrupts pure-rename commits in this repo - Explicitly authorized by user for this one commit Changes (343 total: 169 deletions + 174 renames): Binaries purged (~167 MB): - veza-backend-api/{server,modern-server,encrypt_oauth_tokens,seed,seed-v2} Generated reports purged: - 9 apps/web/lint_report*.json (~32 MB) - 8 apps/web/tsc_*.{log,txt} + ts_*.log (TS error snapshots) - 3 apps/web/storybook_*.json (1375+ stored errors) - apps/web/{build_errors*,build_output,final_errors}.txt - 70 veza-backend-api/coverage*.out + coverage_groups/ (~4 MB) - 3 veza-backend-api/internal/handlers/*.bak Root cleanup: - 54 audit-*.png (visual regression baselines, ~11 MB) - 9 stale MVP-era scripts (Jan 27, hardcoded v0.101): start_{iteration,mvp,recovery}.sh, test_{mvp_endpoints,protected_endpoints,user_journey}.sh, validate_v0101.sh, verify_logs_setup.sh, gen_hash.py Session docs archived (not deleted — preserved under docs/archive/): - 78 apps/web/*.md → docs/archive/frontend-sessions-2026/ - 43 veza-backend-api/*.md → docs/archive/backend-sessions-2026/ - 53 docs/{RETROSPECTIVE_V,SMOKE_TEST_V,PLAN_V0_,V0_*_RELEASE_SCOPE, AUDIT_,PLAN_ACTION_AUDIT,REMEDIATION_PROGRESS}*.md → docs/archive/v0-history/ README.md and CONTRIBUTING.md preserved in apps/web/ and veza-backend-api/. Note: The .gitignore rules preventing recurrence were already pushed in02728909fand remain in place — this commit does not modify .gitignore. Refs: AUDIT_REPORT.md §11
197 lines
5.8 KiB
Markdown
197 lines
5.8 KiB
Markdown
# Plan d'Amélioration de la Couverture de Tests
|
|
|
|
**Date:** 2025-01-27
|
|
**Objectif:** Atteindre 80%+ de couverture de tests
|
|
|
|
---
|
|
|
|
## 📊 État Actuel
|
|
|
|
### Tests Existants
|
|
- ✅ **73 fichiers** `.test.ts` (tests unitaires)
|
|
- ✅ **170 fichiers** `.test.tsx` (tests composants)
|
|
- ✅ **18 fichiers** `.spec.ts` (tests E2E Playwright)
|
|
- ✅ Vitest configuré avec seuil de 80%
|
|
- ✅ Playwright configuré pour tests E2E
|
|
|
|
### Composants UI avec Tests
|
|
- ✅ `avatar.test.tsx`
|
|
- ✅ `badge.test.tsx`
|
|
- ✅ `button.test.tsx`
|
|
- ✅ `card.test.tsx`
|
|
- ✅ `dialog.test.tsx`
|
|
- ✅ `dropdown.test.tsx`
|
|
- ✅ `file-upload.test.tsx`
|
|
- ✅ `loading-spinner.test.tsx`
|
|
- ✅ `modal.test.tsx`
|
|
- ✅ `select.test.tsx`
|
|
- ✅ `skeleton.test.tsx`
|
|
- ✅ `tooltip.test.tsx`
|
|
- ✅ `date-picker.test.tsx`
|
|
|
|
### Composants UI SANS Tests (à créer)
|
|
- ❌ `alert.tsx`
|
|
- ❌ `avatar-upload.tsx`
|
|
- ❌ `button-loading.tsx`
|
|
- ❌ `checkbox.tsx`
|
|
- ❌ `confirmation-dialog.tsx`
|
|
- ❌ `DataList.tsx`
|
|
- ❌ `dropdown-menu.tsx`
|
|
- ❌ `empty-state.tsx`
|
|
- ❌ `focus-trap.tsx`
|
|
- ❌ `FormField.tsx`
|
|
- ❌ `HelpText.tsx`
|
|
- ❌ `ImageCropper.tsx`
|
|
- ❌ `ImageViewerModal.tsx`
|
|
- ❌ `input.tsx`
|
|
- ❌ `label.tsx`
|
|
- ❌ `LazyComponent.tsx`
|
|
- ❌ `optimized-image.tsx`
|
|
- ❌ `progress.tsx`
|
|
- ❌ `radio-group.tsx`
|
|
- ❌ `scroll-area.tsx`
|
|
- ❌ `slider.tsx`
|
|
- ❌ `switch.tsx`
|
|
- ❌ `table.tsx`
|
|
- ❌ `tabs.tsx`
|
|
- ❌ `textarea.tsx`
|
|
- ❌ `Toast.tsx`
|
|
- ❌ `virtualized-list.tsx`
|
|
- ❌ `WaveformVisualizer.tsx`
|
|
|
|
**Total:** ~28 composants UI sans tests
|
|
|
|
---
|
|
|
|
## 🎯 Plan d'Action
|
|
|
|
### Phase 1: Tests Composants UI Critiques (Priorité Haute)
|
|
**Objectif:** Couvrir les composants UI les plus utilisés
|
|
|
|
#### Semaine 1-2
|
|
- [ ] `input.tsx` - Composant critique, utilisé partout
|
|
- [ ] `checkbox.tsx` - Composant critique
|
|
- [ ] `textarea.tsx` - Composant critique
|
|
- [ ] `progress.tsx` - Composant critique
|
|
- [ ] `alert.tsx` - Composant critique pour feedback
|
|
- [ ] `tabs.tsx` - Composant critique pour navigation
|
|
- [ ] `switch.tsx` - Composant critique pour settings
|
|
|
|
#### Semaine 3-4
|
|
- [ ] `table.tsx` - Composant critique pour données
|
|
- [ ] `radio-group.tsx` - Composant critique
|
|
- [ ] `slider.tsx` - Composant critique
|
|
- [ ] `empty-state.tsx` - Composant critique pour UX
|
|
- [ ] `label.tsx` - Composant critique pour formulaires
|
|
- [ ] `scroll-area.tsx` - Composant critique
|
|
|
|
### Phase 2: Tests Composants UI Avancés (Priorité Moyenne)
|
|
**Objectif:** Couvrir les composants UI spécialisés
|
|
|
|
#### Semaine 5-6
|
|
- [ ] `ImageCropper.tsx` - Composant spécialisé
|
|
- [ ] `avatar-upload.tsx` - Composant spécialisé
|
|
- [ ] `confirmation-dialog.tsx` - Composant spécialisé
|
|
- [ ] `dropdown-menu.tsx` - Composant spécialisé
|
|
- [ ] `Toast.tsx` - Composant spécialisé
|
|
- [ ] `ImageViewerModal.tsx` - Composant spécialisé
|
|
|
|
#### Semaine 7-8
|
|
- [ ] `WaveformVisualizer.tsx` - Composant spécialisé audio
|
|
- [ ] `virtualized-list.tsx` - Composant spécialisé performance
|
|
- [ ] `optimized-image.tsx` - Composant spécialisé performance
|
|
- [ ] `LazyComponent.tsx` - Composant spécialisé performance
|
|
- [ ] `FormField.tsx` - Composant spécialisé formulaires
|
|
- [ ] `HelpText.tsx` - Composant spécialisé formulaires
|
|
- [ ] `DataList.tsx` - Composant spécialisé données
|
|
- [ ] `focus-trap.tsx` - Composant spécialisé accessibilité
|
|
- [ ] `button-loading.tsx` - Composant spécialisé UX
|
|
|
|
### Phase 3: Tests Services & Utilitaires (Priorité Haute)
|
|
**Objectif:** Couvrir la logique métier
|
|
|
|
#### Services à Tester (20 fichiers)
|
|
- [ ] `adminService.ts` - Tests manquants
|
|
- [ ] `analyticsService.ts` - Tests manquants
|
|
- [ ] `chatService.ts` - Tests manquants
|
|
- [ ] `commerceService.ts` - Tests manquants
|
|
- [ ] `developerService.ts` - Tests manquants
|
|
- [ ] `educationService.ts` - Tests manquants
|
|
- [ ] `gamificationService.ts` - Tests manquants
|
|
- [ ] `gearService.ts` - Tests manquants
|
|
- [ ] `groupService.ts` - Tests manquants
|
|
- [ ] `marketplaceService.ts` - ✅ Déjà testé
|
|
- [ ] `playlistService.ts` - Tests manquants
|
|
- [ ] `projectService.ts` - Tests manquants
|
|
- [ ] `searchService.ts` - Tests manquants
|
|
- [ ] `sessionService.ts` - Tests manquants
|
|
- [ ] `socialService.ts` - Tests manquants
|
|
- [ ] `storageService.ts` - Tests manquants
|
|
- [ ] `uploadService.ts` - Tests manquants
|
|
- [ ] `userService.ts` - Tests manquants
|
|
|
|
### Phase 4: Tests Context & Hooks (Priorité Moyenne)
|
|
**Objectif:** Couvrir la gestion d'état
|
|
|
|
#### Context à Tester (5 fichiers)
|
|
- [ ] `AudioContext.tsx` - Tests manquants
|
|
- [ ] `AuthContext.tsx` - Tests manquants
|
|
- [ ] `CartContext.tsx` - Tests manquants
|
|
- [ ] `ThemeContext.tsx` - Tests manquants
|
|
- [ ] `ToastContext.tsx` - Tests manquants
|
|
|
|
#### Hooks à Tester (~21 fichiers)
|
|
- [ ] Vérifier quels hooks ont déjà des tests
|
|
- [ ] Créer tests pour hooks manquants
|
|
|
|
### Phase 5: Tests Composants Views (Priorité Basse)
|
|
**Objectif:** Couvrir les vues principales
|
|
|
|
#### Views à Tester (~21 fichiers)
|
|
- [ ] `AdminView.tsx`
|
|
- [ ] `AnalyticsView.tsx`
|
|
- [ ] `AuthView.tsx`
|
|
- [ ] `ChatView.tsx`
|
|
- [ ] `EducationView.tsx`
|
|
- [ ] `FileDetailsView.tsx`
|
|
- [ ] `FileManagerView.tsx`
|
|
- [ ] `GearView.tsx`
|
|
- [ ] `LiveView.tsx`
|
|
- [ ] `MarketplaceView.tsx`
|
|
- [ ] `NotificationsView.tsx`
|
|
- [ ] `ProfileView.tsx`
|
|
- [ ] `PurchasesView.tsx`
|
|
- [ ] `SearchPageView.tsx`
|
|
- [ ] `SettingsView.tsx`
|
|
- [ ] `SocialView.tsx`
|
|
- [ ] `UploadView.tsx`
|
|
|
|
---
|
|
|
|
## 📈 Métriques de Succès
|
|
|
|
### Objectifs
|
|
- ✅ **80%+ couverture globale**
|
|
- ✅ **90%+ couverture pour composants UI critiques**
|
|
- ✅ **80%+ couverture pour services**
|
|
- ✅ **70%+ couverture pour views**
|
|
|
|
### Outils
|
|
- Vitest avec `@vitest/coverage-v8`
|
|
- Playwright pour tests E2E
|
|
- MSW pour mocks API
|
|
|
|
---
|
|
|
|
## 🚀 Prochaines Étapes Immédiates
|
|
|
|
1. ✅ Installer `@vitest/coverage-v8`
|
|
2. ⏳ Générer rapport de couverture actuel
|
|
3. ⏳ Identifier zones critiques avec faible couverture
|
|
4. ⏳ Créer tests pour composants UI critiques en priorité
|
|
5. ⏳ Créer tests pour services manquants
|
|
|
|
---
|
|
|
|
**Dernière mise à jour:** 2025-01-27
|
|
|