Skip to content

test(dashboard): pin fake timers in mock routes test#520

Merged
dcramer merged 2 commits into
mainfrom
fix/dashboard-mock-routes-fake-timers
Jun 5, 2026
Merged

test(dashboard): pin fake timers in mock routes test#520
dcramer merged 2 commits into
mainfrom
fix/dashboard-mock-routes-fake-timers

Conversation

@sentry-junior
Copy link
Copy Markdown
Contributor

@sentry-junior sentry-junior Bot commented Jun 5, 2026

Summary

The overlays mock conversations for local dashboard visual QA test began failing after 2026-06-05 — 7 days past the hardcoded session dates in the mock reporting fixture.

recentConversationGroups filters sessions older than 7 days from Date.now(). The test's fixture uses lastSeenAt: "2026-05-29T00:00:01.000Z", which fell outside the window once the wall clock advanced past that threshold.

Fix

Pin Date.now() via vi.useFakeTimers({ now: new Date("2026-05-29T00:00:00.000Z") }) in the failing test. The existing afterEach(() => vi.useRealTimers()) already handles cleanup.

The same fix was applied to release/0.67.0 in-place to unblock the pending release.

Refs: pre-existing failure introduced in 52e49e02 (feat(dashboard): Add plugin and conversation stats).


View Session in Sentry

The mock reporting fixture uses hardcoded session dates around 2026-05-29.
recentConversationGroups filters sessions older than 7 days from Date.now(),
so the test began failing once the wall clock passed that threshold.

Pin time with vi.useFakeTimers so the fixture stays within the stats window.

Co-authored-by: U039RR91S <noreply>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jun 5, 2026 12:54am

Request Review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 84024a3. Configure here.

Comment thread packages/junior-dashboard/tests/dashboard-mock-routes.test.ts Outdated
Co-authored-by: U039RR91S <noreply>
@dcramer dcramer merged commit ef44adc into main Jun 5, 2026
16 checks passed
@dcramer dcramer deleted the fix/dashboard-mock-routes-fake-timers branch June 5, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant