Skip to content

chore(testing): Wait for SB#1814

Open
Tobbe wants to merge 2 commits into
mainfrom
tobbe-chore-testing-wait-for-sb
Open

chore(testing): Wait for SB#1814
Tobbe wants to merge 2 commits into
mainfrom
tobbe-chore-testing-wait-for-sb

Conversation

@Tobbe
Copy link
Copy Markdown
Member

@Tobbe Tobbe commented May 22, 2026

Try to make Storybook tests a little less flaky

@netlify
Copy link
Copy Markdown

netlify Bot commented May 22, 2026

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 3c1ab6b
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/6a105fe64507180008abdc3f

@github-actions github-actions Bot added this to the chore milestone May 22, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 22, 2026

Greptile Summary

This PR reduces flakiness in the Storybook smoke-test suite by waiting for the BlogPostCell sidebar entry to be visible before interacting with it, acknowledging that Storybook's story index may still be compiling when the server port first becomes ready. It also adds cosmetic blank-line spacing in preset.ts.

  • The readiness waitFor (30 s timeout) is added only to the first test; the second and fourth tests navigate to / and immediately interact with the sidebar without an equivalent guard, leaving them still susceptible to the same timing issue.
  • The preset.ts change is purely whitespace with no behavioural effect.
  • The project-overview documentation remains accurate; nothing in this PR changes any documented architectural facts.

Confidence Score: 4/5

Safe to merge; the changes are low-risk and move in the right direction, though the flakiness fix is only partially applied.

The wait guard is a genuine improvement for the first test, but the second and fourth tests still navigate to / and immediately interact with the sidebar without any readiness check — the same race condition the PR set out to address. The preset.ts changes are purely cosmetic and carry no risk.

tasks/smoke-tests/storybook/tests/storybook.spec.ts — the second and fourth tests could benefit from the same sidebar-ready guard added to the first test.

Important Files Changed

Filename Overview
tasks/smoke-tests/storybook/tests/storybook.spec.ts Adds a 30 s sidebar-visibility wait before the first test's click; the same guard is not applied to the second and fourth tests, which could still be flaky for the same reason.
packages/storybook/src/preset.ts Whitespace-only changes (blank lines added between code blocks in the exportedNames logic); no behavioural impact.

Comments Outside Diff (1)

  1. tasks/smoke-tests/storybook/tests/storybook.spec.ts, line 68-75 (link)

    P2 Other tests still lack the sidebar-ready wait

    The flakiness fix guards only the first test. The second test ('Loads Cell mocks when Cell is nested in another story', line 71) and the fourth test ('Loads MDX Stories', line 162) both call page.goto('/') and then immediately interact with the sidebar — the exact same race that prompted this change. If Storybook's story index is still building when goto resolves, these tests can fail for the same reason.

Reviews (1): Last reviewed commit: "format presets" | Re-trigger Greptile

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 22, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 3c1ab6b

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 5s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 4s View ↗
nx run-many -t build ✅ Succeeded 4s View ↗
nx run-many -t test:types ✅ Succeeded 7s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-22 14:00:17 UTC

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