Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

test(content): wait for the Export dialog to move focus in before the arrow-key check (#1448)

Cihancb5d4573ee8e
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_export-dialog.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_export-dialog.test.tsx
index bb1fbe8c2..0a1c06004 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_export-dialog.test.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_export-dialog.test.tsx
@@ -266,6 +266,9 @@ describe('ExportDialog', () => {
it('downloads Word and Markdown with the page fields, and remembers the destination', async () => {
await render({ html: '<p>Done.</p>' });
+ // The dialog moves focus in after it opens: once it has, it won't take
+ // focus back from the arrow keys (it did on a busy machine).
+ await vi.waitFor(() => expect(dialog().contains(document.activeElement)).toBe(true));
// Arrow keys move along the destinations.
destination('Webflow').focus();
await act(async () => {