Skip to content

Commit eb56726

Browse files
committed
Test iframe visibility
1 parent 9789df9 commit eb56726

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

site/src/pages/TaskPage/TaskPage.stories.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Meta, StoryObj } from "@storybook/react";
2-
import { spyOn } from "@storybook/test";
1+
import type { Meta, StoryObj, } from "@storybook/react";
2+
import { spyOn, within, expect } from "@storybook/test";
33
import {
44
MockFailedWorkspace,
55
MockStartingWorkspace,
@@ -115,9 +115,8 @@ export const Active: Story = {
115115
...MockWorkspaceApp,
116116
id: "claude-code",
117117
display_name: "Claude Code",
118+
slug: "claude-code",
118119
icon: "/icon/claude.svg",
119-
url: `${window.location.protocol}/iframe.html?viewMode=story&id=pages-terminal--ready&args=&globals=`,
120-
external: true,
121120
statuses: [
122121
MockWorkspaceAppStatus,
123122
{
@@ -131,11 +130,13 @@ export const Active: Story = {
131130
{
132131
...MockWorkspaceApp,
133132
id: "vscode",
133+
slug: "vscode",
134134
display_name: "VS Code Web",
135135
icon: "/icon/code.svg",
136136
},
137137
{
138138
...MockWorkspaceApp,
139+
slug: "zed",
139140
id: "zed",
140141
display_name: "Zed",
141142
icon: "/icon/zed.svg",
@@ -153,4 +154,15 @@ export const Active: Story = {
153154
},
154155
});
155156
},
157+
play: async ({ canvasElement }) => {
158+
const canvas = within(canvasElement);
159+
160+
const vscodeIframe = await canvas.findByTitle("VS Code Web");
161+
const zedIframe = await canvas.findByTitle("Zed");
162+
const claudeIframe = await canvas.findByTitle("Claude Code");
163+
164+
expect(vscodeIframe).not.toBeVisible()
165+
expect(zedIframe).not.toBeVisible()
166+
expect(claudeIframe).toBeVisible()
167+
}
156168
};

0 commit comments

Comments
 (0)