-
Notifications
You must be signed in to change notification settings - Fork 962
chore: fix storybook flakes #19366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: fix storybook flakes #19366
Changes from all commits
ee94d39
51e4b79
7c34502
c324c44
13401e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,15 +11,15 @@ import { templateByNameKey } from "api/queries/templates"; | |
import { workspaceByOwnerAndNameKey } from "api/queries/workspaces"; | ||
import type { Workspace } from "api/typesGenerated"; | ||
import { | ||
reactRouterNestedAncestors, | ||
reactRouterOutlet, | ||
reactRouterParameters, | ||
} from "storybook-addon-remix-react-router"; | ||
import { WorkspaceSettingsLayout } from "../WorkspaceSettingsLayout"; | ||
import WorkspaceSchedulePage from "./WorkspaceSchedulePage"; | ||
|
||
const meta = { | ||
title: "pages/WorkspaceSchedulePage", | ||
component: WorkspaceSchedulePage, | ||
component: WorkspaceSettingsLayout, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer that this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Me too. The issue was, when using the nested layout function, the react-router decorator was load before any other local decorators, because of how we set it in the preview config, injecting the workspace settings layout before the dashboard provider that is required to make the it work. IMO, we should simplify the global decorators and let the stories define what they want to use. Improving performance and make easier to identify the story dependencies. |
||
decorators: [withAuthProvider, withDashboardProvider], | ||
parameters: { | ||
layout: "fullscreen", | ||
|
@@ -52,11 +52,11 @@ function workspaceRouterParameters(workspace: Workspace) { | |
workspace: workspace.name, | ||
}, | ||
}, | ||
routing: reactRouterNestedAncestors( | ||
routing: reactRouterOutlet( | ||
{ | ||
path: "/:username/:workspace/settings/schedule", | ||
}, | ||
<WorkspaceSettingsLayout />, | ||
<WorkspaceSchedulePage />, | ||
), | ||
}); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for just unrolling this loop. 😄 this implementation was clever but is far less understandable at a glance, despite being like 1/3rd the lines of code.