Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: simplify mocked timers
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux authored and Antreesy committed Dec 3, 2025
commit 07535d9dae01a692a034b07d3f04a2ac923b0abb
5 changes: 2 additions & 3 deletions src/__tests__/Activity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ test('Display relative date gets updated every minutes', async () => {
expect(wrapper.text()).toContain('You renamed Test file - renamed.md to Test file - renamed - looooooooong.md')
expect(wrapper.find('[data-testid="activity-date"]').text()).toContain('3 days ago')

const currentDatePlusOneDay = new Date('2021-05-03T12:00:00+00:00')
vi.setSystemTime(currentDatePlusOneDay)
vi.advanceTimersByTime(60 * 1000)
vi.advanceTimersByTime(24 * 60 * 60 * 1000)
await nextTick()

expect(wrapper.find('[data-testid="activity-date"]').text()).toContain('4 days ago')
})

Expand Down