Skip to content

Commit 47dd436

Browse files
committed
update storybook
1 parent 223520f commit 47dd436

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

site/src/pages/TasksPage/TasksPage.stories.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,29 @@ export const LoadedTasksWaitingForInputTab: Story = {
145145
spyOn(API, "getTasks").mockResolvedValue([
146146
{
147147
...firstTask,
148+
id: "active-idle-task",
149+
display_name: "Active Idle Task",
150+
status: "active",
151+
current_state: {
152+
...firstTask.current_state,
153+
state: "idle",
154+
},
155+
},
156+
{
157+
...firstTask,
158+
id: "paused-idle-task",
159+
display_name: "Paused Idle Task",
160+
status: "paused",
161+
current_state: {
162+
...firstTask.current_state,
163+
state: "idle",
164+
},
165+
},
166+
{
167+
...firstTask,
168+
id: "error-idle-task",
169+
display_name: "Error Idle Task",
170+
status: "error",
148171
current_state: {
149172
...firstTask.current_state,
150173
state: "idle",
@@ -162,6 +185,12 @@ export const LoadedTasksWaitingForInputTab: Story = {
162185
});
163186
await userEvent.click(waitingForInputTab);
164187
});
188+
189+
await step("Only active idle tasks should be visible", async () => {
190+
expect(await canvas.findByText("Active Idle Task")).toBeInTheDocument();
191+
expect(canvas.queryByText("Paused Idle Task")).not.toBeInTheDocument();
192+
expect(canvas.queryByText("Error Idle Task")).not.toBeInTheDocument();
193+
});
165194
},
166195
};
167196

0 commit comments

Comments
 (0)