test: fix timezone issues in EventDisplay tests

- Set explicit UTC timezone globally in jest.config.ts and setupTests.ts
- Mock Intl.DateTimeFormat to use UTC by default while preserving prototype
- Replace regex patterns with exact values for declarative assertions
- Remove complex date formatting computations in tests
- Use fixed dates (2025-01-15T10:00:00.000Z) for consistent test results
- Fix EventDisplay.test.tsx to use exact time values instead of regex
This commit is contained in:
lenhanphung
2025-10-10 15:04:03 +07:00
committed by Benoit TELLIER
parent 59e7992cfe
commit 192ab17789
3 changed files with 59 additions and 46 deletions
+3
View File
@@ -1,5 +1,8 @@
import type { Config } from "jest";
// Set timezone to UTC for consistent test results across all environments
process.env.TZ = "UTC";
const config: Config = {
collectCoverage: true,
coverageDirectory: "coverage",