Skip to content

Commit f6ba089

Browse files
authored
Merge branch 'jakehwll/implement-storybook' into jakehwll/implement-chromatic
2 parents 62208d8 + 19f74de commit f6ba089

1 file changed

Lines changed: 1 addition & 43 deletions

File tree

packages/tasks/src/components/TasksPanel.stories.tsx

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { task } from "@repo/mocks";
22
import { withQueryClient } from "@repo/storybook-utils";
3-
import { expect, fn, userEvent, waitFor } from "@storybook/test";
3+
import { fn } from "@storybook/test";
44

55
import { withTasksStyles } from "../utils/storybook";
66

@@ -50,30 +50,6 @@ export const CollapsibleToggle: Story = {
5050
save: fn(),
5151
},
5252
},
53-
play: async ({ canvasElement }) => {
54-
// Find all vscode-collapsible elements
55-
const collapsibles =
56-
canvasElement.querySelectorAll<HTMLElement>("vscode-collapsible");
57-
58-
// Should have two collapsible sections
59-
await expect(collapsibles.length).toBe(2);
60-
61-
// Both should be initially closed
62-
await expect(collapsibles[0].hasAttribute("open")).toBe(false);
63-
await expect(collapsibles[1].hasAttribute("open")).toBe(false);
64-
65-
// Simulate the collapsible toggle event that would be fired when clicking
66-
const toggleEvent = new CustomEvent("vsc-collapsible-toggle", {
67-
detail: { open: true },
68-
bubbles: true,
69-
});
70-
collapsibles[0].dispatchEvent(toggleEvent);
71-
72-
// Wait for the state to update and the open attribute to be set
73-
await waitFor(() => {
74-
expect(collapsibles[0].hasAttribute("open")).toBe(true);
75-
});
76-
},
7753
};
7854

7955
export const TaskSelection: Story = {
@@ -90,22 +66,4 @@ export const TaskSelection: Story = {
9066
save: fn(),
9167
},
9268
},
93-
play: async ({ canvasElement }) => {
94-
// Find the first task item in the list
95-
const taskItem = canvasElement.querySelector(".task-item");
96-
await expect(taskItem).toBeTruthy();
97-
98-
if (!taskItem) {
99-
throw new Error("Task item not found");
100-
}
101-
102-
// Click on the task to select it
103-
await userEvent.click(taskItem);
104-
105-
// In Storybook the IPC layer is mocked, so selecting a task triggers
106-
// a detail fetch that never resolves. The loading spinner is the
107-
// expected terminal state for this interaction test.
108-
const loadingContainer = canvasElement.querySelector(".loading-container");
109-
await expect(loadingContainer).toBeTruthy();
110-
},
11169
};

0 commit comments

Comments
 (0)