You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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)
tasks/smoke-tests/storybook/tests/storybook.spec.ts, line 68-75 (link)
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.
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
☁️ Nx Cloud last updated this comment at 2026-05-22 14:00:17 UTC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Try to make Storybook tests a little less flaky