File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,9 +2,23 @@ import ThemeProvider from "@material-ui/styles/ThemeProvider"
22import { withThemes } from "@react-theming/storybook-addon"
33import { light , dark } from "../theme"
44import { addDecorator } from "node_modules/@storybook/react"
5+ import { createMemoryHistory } from "history"
6+ import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom"
57
68addDecorator ( withThemes ( ThemeProvider , [ light , dark ] ) )
79
10+ const history = createMemoryHistory ( )
11+
12+ const routerDecorator = ( Story ) => {
13+ return (
14+ < HistoryRouter history = { history } >
15+ < Story />
16+ </ HistoryRouter >
17+ )
18+ }
19+
20+ addDecorator ( routerDecorator )
21+
822export const parameters = {
923 actions : {
1024 argTypesRegex : "^on[A-Z].*" ,
Original file line number Diff line number Diff line change 11import { Story } from "@storybook/react"
22import React from "react"
33import { Workspace , WorkspaceProps } from "./Workspace"
4- import { MockWorkspace } from "../../test_helpers"
4+ import { MockOrganization , MockProject , MockWorkspace } from "../../test_helpers"
55
66export default {
77 title : "Workspace" ,
@@ -13,5 +13,7 @@ const Template: Story<WorkspaceProps> = (args) => <Workspace {...args} />
1313
1414export const Example = Template . bind ( { } )
1515Example . args = {
16+ organization : MockOrganization ,
17+ project : MockProject ,
1618 workspace : MockWorkspace ,
1719}
You can’t perform that action at this time.
0 commit comments