Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

test(dify-ui): stabilize ContextMenu explicit anatomy story (#44784)

yyhaebe697e0c15
diff --git a/packages/dify-ui/src/context-menu/index.stories.tsx b/packages/dify-ui/src/context-menu/index.stories.tsx
index 6937760b80b..9ae3c6a437d 100644
--- a/packages/dify-ui/src/context-menu/index.stories.tsx
+++ b/packages/dify-ui/src/context-menu/index.stories.tsx
@@ -287,6 +287,9 @@ export const ExplicitAnatomy: Story = {
trigger.getBoundingClientRect().bottom + 7,
),
)
+ // A pointer open focuses the role="menu" element in a deferred animation frame; list
+ // navigation only handles ArrowDown once that focus lands.
+ await waitFor(() => expect(popup).toHaveFocus())
await userEvent.keyboard('{ArrowDown}')
await waitFor(() => expect(body.getByRole('menuitem', { name: 'Share' })).toHaveFocus())
await userEvent.keyboard('{ArrowRight}')