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" ;
3
3
import {
4
4
MockFailedWorkspace ,
5
5
MockStartingWorkspace ,
@@ -115,9 +115,8 @@ export const Active: Story = {
115
115
...MockWorkspaceApp ,
116
116
id : "claude-code" ,
117
117
display_name : "Claude Code" ,
118
+ slug : "claude-code" ,
118
119
icon : "/icon/claude.svg" ,
119
- url : `${ window . location . protocol } /iframe.html?viewMode=story&id=pages-terminal--ready&args=&globals=` ,
120
- external : true ,
121
120
statuses : [
122
121
MockWorkspaceAppStatus ,
123
122
{
@@ -131,11 +130,13 @@ export const Active: Story = {
131
130
{
132
131
...MockWorkspaceApp ,
133
132
id : "vscode" ,
133
+ slug : "vscode" ,
134
134
display_name : "VS Code Web" ,
135
135
icon : "/icon/code.svg" ,
136
136
} ,
137
137
{
138
138
...MockWorkspaceApp ,
139
+ slug : "zed" ,
139
140
id : "zed" ,
140
141
display_name : "Zed" ,
141
142
icon : "/icon/zed.svg" ,
@@ -153,4 +154,15 @@ export const Active: Story = {
153
154
} ,
154
155
} ) ;
155
156
} ,
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
+ }
156
168
} ;
0 commit comments