Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

test(workflow): wait for the card menu's placement before reading it

Josh Corbettafc4998b9a36
diff --git a/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDialog.browser.test.tsx b/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDialog.browser.test.tsx
index e0d592e9a1..dfbef1b56f 100644
--- a/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDialog.browser.test.tsx
+++ b/invokeai/frontend/webv2/src/features/workflow/ui/library/WorkflowLibraryDialog.browser.test.tsx
@@ -691,8 +691,12 @@ describe('WorkflowLibraryDialog', () => {
const menu = () => document.querySelector<HTMLElement>('[data-workflow-context-menu]');
- await vi.waitFor(() => expect(menu()).not.toBeNull());
- expect(menu()!.getBoundingClientRect().left).toBeGreaterThan(card('wf-landscape')!.getBoundingClientRect().left);
+ // The positioner places the menu a frame after it mounts; anchored inside the card, not at the viewport corner.
+ await vi.waitFor(() =>
+ expect(menu()?.getBoundingClientRect().left ?? 0).toBeGreaterThan(
+ card('wf-landscape')!.getBoundingClientRect().left
+ )
+ );
await act(async () => {
await userEvent.keyboard('{Escape}');