Skip to content

fix(site): move pagination test from vitest to storybook story#24165

Merged
DanielleMaywood merged 1 commit into
mainfrom
dm/fix-workspaces-pagination-flake
Apr 8, 2026
Merged

fix(site): move pagination test from vitest to storybook story#24165
DanielleMaywood merged 1 commit into
mainfrom
dm/fix-workspaces-pagination-flake

Conversation

@DanielleMaywood
Copy link
Copy Markdown
Contributor

@DanielleMaywood DanielleMaywood commented Apr 8, 2026

🤖 This PR was written by Coder Agent on behalf of Danielle Maywood 🤖

Fixes coder/internal#1458

The pagination query key test timed out in CI (6204ms vs 5000ms limit) because renderWithAuth boots 12+ MSW round-trips through the auth, dashboard, and proxy provider waterfall before the page even mounts.

Moves the test to a Storybook story where decorators (withAuthProvider, withDashboardProvider, withProxyProvider) pre-seed the query cache and provide context directly, skipping the MSW waterfall entirely. This also aligns with the codebase convention that page interaction tests belong in stories, not vitest files.

@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Apr 8, 2026
@DanielleMaywood DanielleMaywood force-pushed the dm/fix-workspaces-pagination-flake branch from 28226e8 to 65c4867 Compare April 8, 2026 18:38
@DanielleMaywood DanielleMaywood changed the title fix: reduce workspace count in pagination test to prevent CI timeout fix(site): move pagination test from vitest to storybook story Apr 8, 2026
@DanielleMaywood DanielleMaywood removed the community Pull Requests and issues created by the community. label Apr 8, 2026
@DanielleMaywood DanielleMaywood force-pushed the dm/fix-workspaces-pagination-flake branch 3 times, most recently from 4c02b07 to 0787a75 Compare April 8, 2026 19:36
@DanielleMaywood DanielleMaywood marked this pull request as ready for review April 8, 2026 19:38
The pagination query key test timed out in CI (6204ms vs 5000ms limit)
because renderWithAuth boots 12+ MSW round-trips through the auth,
dashboard, and proxy provider waterfall before the page even mounts.

Move the test to a Storybook story where decorators pre-seed the query
cache and provide context directly, skipping the MSW waterfall entirely.
Both page query keys are pre-populated via parameters.queries so no API
spy is needed — the rendered output alone proves the query key includes
pagination parameters. Also exports workspacesKey from the queries
module so stories can reference it directly.

This aligns with the codebase convention that page interaction tests
belong in stories, not vitest files.
@DanielleMaywood DanielleMaywood force-pushed the dm/fix-workspaces-pagination-flake branch from 0787a75 to e8d6876 Compare April 8, 2026 19:46
Copy link
Copy Markdown
Contributor

@jeremyruppel jeremyruppel left a comment

Choose a reason for hiding this comment

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

very nice! 🙏

@DanielleMaywood DanielleMaywood merged commit 12ada01 into main Apr 8, 2026
27 checks passed
@DanielleMaywood DanielleMaywood deleted the dm/fix-workspaces-pagination-flake branch April 8, 2026 19:56
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flake: WorkspacesPage pagination query key test

2 participants