Skip to content

Commit 27ef4a9

Browse files
committed
Fix stories
1 parent e879160 commit 27ef4a9

File tree

4 files changed

+53
-4
lines changed

4 files changed

+53
-4
lines changed

site/src/components/AppLink/AppLink.stories.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
import { Story } from "@storybook/react"
22
import {
3+
MockPrimaryRegion,
4+
MockRegions,
35
MockWorkspace,
46
MockWorkspaceAgent,
57
MockWorkspaceApp,
68
} from "testHelpers/entities"
79
import { AppLink, AppLinkProps } from "./AppLink"
10+
import { ProxyContext } from "contexts/ProxyContext"
11+
import { getURLs } from "contexts/ProxyContext"
812

913
export default {
1014
title: "components/AppLink",
1115
component: AppLink,
1216
}
1317

14-
const Template: Story<AppLinkProps> = (args) => <AppLink {...args} />
18+
const Template: Story<AppLinkProps> = (args) => (
19+
<ProxyContext.Provider
20+
value={{
21+
proxy: getURLs(MockRegions, MockPrimaryRegion),
22+
isLoading: false,
23+
setProxy: () => {
24+
return
25+
},
26+
}}
27+
>
28+
<AppLink {...args} />
29+
</ProxyContext.Provider>
30+
)
1531

1632
export const WithIcon = Template.bind({})
1733
WithIcon.args = {

site/src/components/Resources/AgentRow.stories.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Story } from "@storybook/react"
22
import {
3+
MockPrimaryRegion,
4+
MockRegions,
35
MockWorkspace,
46
MockWorkspaceAgent,
57
MockWorkspaceAgentConnecting,
@@ -16,6 +18,7 @@ import {
1618
MockWorkspaceApp,
1719
} from "testHelpers/entities"
1820
import { AgentRow, AgentRowProps } from "./AgentRow"
21+
import { ProxyContext, getURLs } from "contexts/ProxyContext"
1922

2023
export default {
2124
title: "components/AgentRow",
@@ -36,7 +39,19 @@ export default {
3639
},
3740
}
3841

39-
const Template: Story<AgentRowProps> = (args) => <AgentRow {...args} />
42+
const Template: Story<AgentRowProps> = (args) => (
43+
<ProxyContext.Provider
44+
value={{
45+
proxy: getURLs(MockRegions, MockPrimaryRegion),
46+
isLoading: false,
47+
setProxy: () => {
48+
return
49+
},
50+
}}
51+
>
52+
<AgentRow {...args} />
53+
</ProxyContext.Provider>
54+
)
4055

4156
const defaultAgentMetadata = [
4257
{

site/src/components/Workspace/Workspace.stories.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as Mocks from "../../testHelpers/entities"
66
import { Workspace, WorkspaceErrors, WorkspaceProps } from "./Workspace"
77
import { withReactContext } from "storybook-react-context"
88
import EventSource from "eventsourcemock"
9+
import { ProxyContext, getURLs } from "contexts/ProxyContext"
910

1011
export default {
1112
title: "components/Workspace",
@@ -22,7 +23,19 @@ export default {
2223
],
2324
}
2425

25-
const Template: Story<WorkspaceProps> = (args) => <Workspace {...args} />
26+
const Template: Story<WorkspaceProps> = (args) => (
27+
<ProxyContext.Provider
28+
value={{
29+
proxy: getURLs(Mocks.MockRegions, Mocks.MockPrimaryRegion),
30+
isLoading: false,
31+
setProxy: () => {
32+
return
33+
},
34+
}}
35+
>
36+
<Workspace {...args} />
37+
</ProxyContext.Provider>
38+
)
2639

2740
export const Running = Template.bind({})
2841
Running.args = {

site/src/pages/UserSettingsPage/WorkspaceProxyPage/WorspaceProxyView.stories.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { Story } from "@storybook/react"
2-
import { makeMockApiError, MockRegions, MockPrimaryRegion, MockHealthyWildRegion } from "testHelpers/entities"
2+
import {
3+
makeMockApiError,
4+
MockRegions,
5+
MockPrimaryRegion,
6+
MockHealthyWildRegion,
7+
} from "testHelpers/entities"
38
import {
49
WorkspaceProxyPageView,
510
WorkspaceProxyPageViewProps,

0 commit comments

Comments
 (0)