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 dialog's first focus before opening the JSON-LD code (#1753)

Cihan93963168fed4
diff --git a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx
index d5c688275..43c689d2f 100644
--- a/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx
+++ b/web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_before-publish.test.tsx
@@ -682,6 +682,9 @@ describe('BeforePublish', () => {
it('opens and folds the code with one button, its focus on the code it opens', async () => {
await render(quality(), { mode: 'send' });
+ // The dialog moves focus in a frame after it opens: clicked before that, on a
+ // slow run, it takes the focus back from the code.
+ await vi.waitFor(() => expect(document.activeElement).toBe(button('Continue to send')));
const show = button("Show the JSON-LD, for a CMS that doesn't add it")!;
expect(show.getAttribute('aria-expanded')).toBe('false');
await act(async () => show.click());