mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:05:19 +00:00
test(agenda): fixa o relógio do overlay no mês do fixture
O calendário abre no mês corrente e os fixtures (e o startAt submetido) são de agosto/2026: desde 01/09 o teste 'troca dia no calendário' não encontra o dia 15 de agosto e derruba a suíte unit full — que é o que o gate e o CI rodam hoje (o wrapper changed cai no full). Relógio fixo no mês do fixture torna o teste determinístico.
This commit is contained in:
parent
a83b6dd50e
commit
2dead731d8
1 changed files with 8 additions and 0 deletions
|
|
@ -110,6 +110,13 @@ const openDatePicker = (label: string) => {
|
|||
}
|
||||
|
||||
beforeAll(() => {
|
||||
/*
|
||||
* The fixtures (and the submitted `startAt`) live in August 2026 and the
|
||||
* calendar picker opens on the CURRENT month: pin the clock to the fixture
|
||||
* month so the day buttons stay reachable no matter when the suite runs.
|
||||
*/
|
||||
vi.useFakeTimers({ shouldAdvanceTime: true })
|
||||
vi.setSystemTime(new Date('2026-08-10T15:00:00.000Z'))
|
||||
vi.stubGlobal(
|
||||
'ResizeObserver',
|
||||
class {
|
||||
|
|
@ -121,6 +128,7 @@ beforeAll(() => {
|
|||
})
|
||||
|
||||
afterAll(() => {
|
||||
vi.useRealTimers()
|
||||
vi.unstubAllGlobals()
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue