mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-03 06:41:01 +00:00
test: mock formatFullDate for consistent test results
This commit is contained in:
parent
5a694518c9
commit
6668274419
@ -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(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user