Skip to content

Commit 7d9f43c

Browse files
committed
try to add storybook tests
1 parent 17712b2 commit 7d9f43c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

site/src/modules/resources/AgentDevcontainerCard.stories.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Meta, StoryObj } from "@storybook/react";
2+
import { within, userEvent } from "@storybook/test";
23
import {
34
MockWorkspace,
45
MockWorkspaceAgent,
@@ -31,3 +32,30 @@ export const WithPorts: Story = {
3132
},
3233
},
3334
};
35+
36+
export const Dirty: Story = {
37+
args: {
38+
container: {
39+
...MockWorkspaceAgentContainer,
40+
devcontainer_dirty: true,
41+
ports: MockWorkspaceAgentContainerPorts,
42+
},
43+
},
44+
};
45+
46+
export const Recreating: Story = {
47+
args: {
48+
container: {
49+
...MockWorkspaceAgentContainer,
50+
devcontainer_dirty: true,
51+
ports: MockWorkspaceAgentContainerPorts,
52+
},
53+
},
54+
play: async ({ canvasElement }) => {
55+
const canvas = within(canvasElement);
56+
const recreateButton = await canvas.findByRole("button", {
57+
name: /recreate/i,
58+
});
59+
await userEvent.click(recreateButton);
60+
},
61+
};

0 commit comments

Comments
 (0)