test(ratings): add comprehensive E2E test for ratings & stats flow
Add end-to-end test verifying the complete ratings and stats update flow: - Auto match creation from suggestion acceptance - Both users rating each other - Stats updated exactly once (recordingsDone/recordingsReceived) - Manual matches do NOT update stats - Double-rating prevention (idempotency) Test coverage (9 scenarios): - STEP 1-3: Event creation, user enrollment, heat declaration - STEP 4: Matching algorithm execution + saveMatchingResults fix - STEP 5: Suggestion acceptance creates auto match (source='auto') - STEP 6a: First rating (no stats update yet) - STEP 6b: Second rating triggers stats update + match completion - STEP 7: Verify duplicate rating prevention - STEP 8: Verify manual matches don't affect fairness stats Infrastructure: - Add jest.setup.js to load .env.development for all tests - Update package.json to use setupFilesAfterEnv Documentation: - Mark S10 (Ratings & Stats) as ✅ IMPLEMENTED in TODO.md - Remove from Critical Gaps section - Add detailed implementation references All tests passing ✅
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
},
|
||||
"jest": {
|
||||
"testEnvironment": "node",
|
||||
"setupFilesAfterEnv": ["<rootDir>/jest.setup.js"],
|
||||
"coveragePathIgnorePatterns": [
|
||||
"/node_modules/"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user