test: add comprehensive test suite for Matches & Ratings API

- Created matches.test.js with 24 tests covering:
  * Match creation and validation
  * Match listing and filtering
  * Match acceptance workflow
  * Match deletion
  * Rating creation and validation
  * User ratings display

- Fixed Jest ES module issues:
  * Added mock for jsdom to bypass parse5 compatibility
  * Added mock for dompurify for test environment
  * Updated package.json with moduleNameMapper

Test results: 19/24 passing (79%)
Remaining: 5 tests need investigation
This commit is contained in:
Radosław Gierwiało
2025-11-14 23:12:08 +01:00
parent e9f181052c
commit 830f08edba
4 changed files with 544 additions and 1 deletions

View File

@@ -53,7 +53,11 @@
],
"testMatch": [
"**/__tests__/**/*.test.js"
]
],
"moduleNameMapper": {
"^jsdom$": "<rootDir>/src/__mocks__/jsdom.js",
"^dompurify$": "<rootDir>/src/__mocks__/dompurify.js"
}
},
"prisma": {
"seed": "node prisma/seed.js"