Skip to content

Commit e21fede

Browse files
committed
Fix StatusIndicator test selector for tooltip-wrapped indicator
The Clickable story provides a 'title' prop, which wraps the indicator in a Tooltip component. Updated the test selector to query for the div directly instead of looking for a span wrapper that no longer exists with the new shadcn tooltip structure.
1 parent 34cd708 commit e21fede

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/StatusIndicator.stories.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,8 @@ export const Clickable: Story = {
145145
);
146146
},
147147
play: async ({ canvasElement }) => {
148-
// Find the indicator div directly
149-
const wrapper = canvasElement.querySelector("span");
150-
const indicator = wrapper?.querySelector("div");
148+
// Find the indicator div (inside tooltip trigger when title is provided)
149+
const indicator = canvasElement.querySelector("div");
151150
if (!indicator) throw new Error("Could not find indicator");
152151

153152
// Initial state - should be unread (white background)

0 commit comments

Comments
 (0)