Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test(site): fix failing Storybook play functions - #27874

Merged
jakehwll merged 9 commits into
mainfrom
jakehwll/resolve-flaked-storybook-tests
Aug 5, 2026
Merged

test(site): fix failing Storybook play functions#27874
jakehwll merged 9 commits into
mainfrom
jakehwll/resolve-flaked-storybook-tests

Conversation

@jakehwll

@jakehwll jakehwll commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes several Storybook play function failures that show up in Pixel (and some that fail under vitest --project=storybook).

Component / behavior

  • DurationField: restore digit-only filtering so non-numeric input is stripped again. A demui pass had stopped filtering and relied on pattern, which does not prevent typing.

Pixel viewport mismatches

Pixel ignores Storybook viewport params. Shared helpers pixelWithDesktop / pixelWithPhone live in testHelpers/pixel.ts.

  • NavbarView: admin dropdown stories are desktop-only. Pixel tablet is 744px, below Tailwind md (768px), so Admin settings is hidden and the play click fails. MobileMenu already covers the collapsed navbar.
  • AgentPageHeader: mobile meatball menu story is phone-only. At laptop width sm:hidden keeps "More options" out of the a11y tree even when matchMedia is mocked as mobile.

Story assertion fixes

  • WorkspaceSettingsPageView: Formik passes helpers as a second onSubmit argument; the assertion now allows that.
  • AgentChatPageView: sidebar tab persistence stories use Git instead of Terminal. Clicking Terminal mounts xterm, which throws an unhandled dimensions error and fails the run even when tab assertions pass.
  • NetworkCallsTable / Blocked Badge: badge copy is split across an sr-only span and the count; assertion matches combined textContent.
  • CreateOAuth2AppPageView / Default: wait for Formik validate-on-mount before asserting the submit button is disabled.
  • NotificationEvents / Change Method (+ Error): combobox accessible name is now Notification method for ${template}; match with a regex.
  • DynamicClientRegistrationSetting / Keeps Focus While Updating: wait for the Enable label after the harness finishes the request.

Pixel logs play failures but still exits 0, so these can stay green in CI while failing in the Pixel report.

Comment on lines +18 to +22
// The admin settings dropdown is hidden below the `md` breakpoint, where the
// navbar collapses into `MobileMenu`, so stories that open the dropdown can
// only be snapshotted at desktop width. `MobileMenu.stories.tsx` covers the
// collapsed menu.
const desktopOnly = { pixel: { matrix: { viewports: ["desktop"] } } };

@jakehwll jakehwll Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a pixel specific issue... will look into this deeper soon but I'd rather green CI first.

Chromatic’s “tablet” mode used Storybook’s ipad viewport at 768px. At 768px, Tailwind md: (min-width: 768px) applies, so Admin settings is visible and the play click works.

Pixel’s tablet is 744px. That’s under md, so the button is hidden and the play function blows up.

@jakehwll jakehwll changed the title chore(site): flakey storybook tests test(site): fix failing Storybook play functions Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Swapped to using Git here because there was a flake with Terminal (xterm.js). Theoretically the same test.

@jakehwll
jakehwll marked this pull request as ready for review August 5, 2026 06:58
@jakehwll
jakehwll requested a review from ethanndickson August 5, 2026 06:58
Comment thread site/src/testHelpers/pixel.ts Outdated
Co-authored-by: Danielle Maywood <[email protected]>
Comment thread site/src/modules/dashboard/Navbar/NavbarView.stories.tsx Outdated
Comment thread site/src/pages/AgentsPage/components/AgentPageHeader.stories.tsx Outdated
@jakehwll
jakehwll enabled auto-merge (squash) August 5, 2026 09:58
@jakehwll
jakehwll merged commit 05baba1 into main Aug 5, 2026
26 checks passed
@jakehwll
jakehwll deleted the jakehwll/resolve-flaked-storybook-tests branch August 5, 2026 10:06
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 5, 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.

2 participants