From 92c7a46de89f7c523480f36ce2d3ea8f38e20083 Mon Sep 17 00:00:00 2001 From: liugddx Date: Sun, 6 Sep 2026 11:55:21 +0800 Subject: [PATCH] test(storybook): wait for context menu to settle The loading-catalog context menu updates asynchronously when switching from an existing session to a new task. Wait up to five seconds for the menu to remain visible after activating the loading Skills row, avoiding a race in the Storybook smoke assertion. Generated-by: OpenAI Codex --- apps/desktop/stories/composer-slash-menu.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/stories/composer-slash-menu.stories.tsx b/apps/desktop/stories/composer-slash-menu.stories.tsx index 3caf7e535b..07d6d1dd7d 100644 --- a/apps/desktop/stories/composer-slash-menu.stories.tsx +++ b/apps/desktop/stories/composer-slash-menu.stories.tsx @@ -435,7 +435,7 @@ export const ContextSwitchStartsWithALoadingCatalog: Story = { await waitFor(() => expect(skillsRow).toHaveAttribute('aria-busy', 'true')); await expect(skillsRow).not.toHaveAttribute('aria-disabled', 'true'); await userEvent.click(skillsRow); - await expect(menu).toBeVisible(); + await waitFor(() => expect(menu).toBeVisible(), { timeout: 5_000 }); await expect(editor(canvasElement)).toHaveTextContent(''); await expect(page.queryByRole('listbox', { name: /技能/ })).not.toBeInTheDocument();