Skip to content

Commit 2dea433

Browse files
committed
🤖 fix: stabilize storybook Tasks assertions
Fixes Storybook test flake by scoping the "Exec" absence check to the Sub-agents section (avoid matching the global mode selector).\n\n---\n_Generated with • Model: unknown • Thinking: unknown_\n<!-- mux-attribution: model=unknown thinking=unknown --> Change-Id: Ie4298b1cefc43d5866b878da06b3fcf4562636c1 Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent dd1173d commit 2dea433

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

‎src/browser/stories/App.settings.stories.tsx‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,18 @@ export const Tasks: AppStory = {
110110

111111
await body.findByText(/Max Parallel Agent Tasks/i);
112112
await body.findByText(/Max Task Nesting Depth/i);
113-
await body.findByText(/Sub-agents/i);
114-
await body.findByText(/Explore/i);
115-
if (body.queryByText(/Exec/i)) {
113+
const subagentsHeading = await body.findByRole("heading", { name: /Sub-agents/i });
114+
const subagentsSection = subagentsHeading.parentElement;
115+
if (!subagentsSection) {
116+
throw new Error("Expected Sub-agents section container to exist");
117+
}
118+
119+
const subagents = within(subagentsSection);
120+
121+
await subagents.findByText(/^Explore$/i);
122+
123+
const execMatches = subagents.queryAllByText(/^Exec$/i);
124+
if (execMatches.length > 0) {
116125
throw new Error("Expected Exec sub-agent settings to be hidden (always inherits)");
117126
}
118127

0 commit comments

Comments
 (0)