test: mock formatFullDate for consistent test results

This commit is contained in:
Deluan 2025-11-13 18:46:06 -05:00 committed by Joe Stump
parent 5a694518c9
commit 6668274419
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

View File

@ -14,6 +14,24 @@ vi.mock('@material-ui/core', async () => {
}
})
// Mock formatFullDate to return deterministic results
vi.mock('../utils', async () => {
const actual = await import('../utils')
return {
...actual,
formatFullDate: (date) => {
if (!date) return ''
// Use en-CA locale for consistent test results
return new Date(date).toLocaleDateString('en-CA', {
year: 'numeric',
month: 'short',
day: 'numeric',
timeZone: 'UTC',
})
},
}
})
describe('Details component', () => {
describe('Desktop view', () => {
beforeEach(() => {