Skip to content

Commit 49c3a4e

Browse files
committed
Fix stories
1 parent 00e4cfe commit 49c3a4e

File tree

3 files changed

+43
-18
lines changed

3 files changed

+43
-18
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Story } from "@storybook/react"
22
import {
33
MockWorkspace,
4+
MockWorkspaceAgent,
45
MockWorkspaceApp,
56
} from "../../testHelpers/renderHelpers"
67
import { AppLink, AppLinkProps } from "./AppLink"
@@ -22,6 +23,7 @@ WithIcon.args = {
2223
sharing_level: "owner",
2324
health: "healthy",
2425
},
26+
agent: MockWorkspaceAgent,
2527
}
2628

2729
export const WithoutIcon = Template.bind({})
@@ -33,6 +35,7 @@ WithoutIcon.args = {
3335
sharing_level: "owner",
3436
health: "healthy",
3537
},
38+
agent: MockWorkspaceAgent,
3639
}
3740

3841
export const HealthDisabled = Template.bind({})
@@ -44,6 +47,7 @@ HealthDisabled.args = {
4447
sharing_level: "owner",
4548
health: "disabled",
4649
},
50+
agent: MockWorkspaceAgent,
4751
}
4852

4953
export const HealthInitializing = Template.bind({})
@@ -54,6 +58,7 @@ HealthInitializing.args = {
5458
name: "code-server",
5559
health: "initializing",
5660
},
61+
agent: MockWorkspaceAgent,
5762
}
5863

5964
export const HealthUnhealthy = Template.bind({})
@@ -64,4 +69,5 @@ HealthUnhealthy.args = {
6469
name: "code-server",
6570
health: "unhealthy",
6671
},
72+
agent: MockWorkspaceAgent,
6773
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Story } from "@storybook/react"
2+
import { MockWorkspace, MockWorkspaceAgent } from "testHelpers/entities"
3+
import { AgentRow, AgentRowProps } from "./AgentRow"
4+
5+
export default {
6+
title: "components/AgentRow",
7+
component: AgentRow,
8+
}
9+
10+
const Template: Story<AgentRowProps> = (args) => <AgentRow {...args} />
11+
12+
export const Example = Template.bind({})
13+
Example.args = {
14+
agent: MockWorkspaceAgent,
15+
workspace: MockWorkspace,
16+
applicationsHost: "",
17+
showApps: true,
18+
}
19+
20+
export const HideSSHButton = Template.bind({})
21+
HideSSHButton.args = {
22+
agent: MockWorkspaceAgent,
23+
workspace: MockWorkspace,
24+
applicationsHost: "",
25+
showApps: true,
26+
hideSSHButton: true,
27+
}
28+
29+
export const NotShowingApps = Template.bind({})
30+
NotShowingApps.args = {
31+
agent: MockWorkspaceAgent,
32+
workspace: MockWorkspace,
33+
applicationsHost: "",
34+
showApps: false,
35+
}

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

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Story } from "@storybook/react"
22
import {
3-
MockWorkspace,
43
MockWorkspaceAgent,
54
MockWorkspaceApp,
65
MockWorkspaceResource,
76
} from "testHelpers/entities"
7+
import { AgentRowPreview } from "./AgentRowPreview"
88
import { ResourceCard, ResourceCardProps } from "./ResourceCard"
99

1010
export default {
@@ -17,23 +17,7 @@ const Template: Story<ResourceCardProps> = (args) => <ResourceCard {...args} />
1717
export const Example = Template.bind({})
1818
Example.args = {
1919
resource: MockWorkspaceResource,
20-
workspace: MockWorkspace,
21-
applicationsHost: "https://dev.coder.com",
22-
hideSSHButton: false,
23-
showApps: true,
24-
serverVersion: MockWorkspaceAgent.version,
25-
}
26-
27-
export const NotShowingApps = Template.bind({})
28-
NotShowingApps.args = {
29-
...Example.args,
30-
showApps: false,
31-
}
32-
33-
export const HideSSHButton = Template.bind({})
34-
HideSSHButton.args = {
35-
...Example.args,
36-
hideSSHButton: true,
20+
agentRow: (agent) => <AgentRowPreview key={agent.id} agent={agent} />,
3721
}
3822

3923
export const BunchOfApps = Template.bind({})

0 commit comments

Comments
 (0)