From ceb658fec6b878353d1c731f6d3f633295e882f6 Mon Sep 17 00:00:00 2001 From: Max Lampert Date: Fri, 21 Aug 2026 16:40:27 -0700 Subject: [PATCH] test(desktop): survive early menu dismissals in the agent-voice spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shortly after a cold load, background huddle-state settling re-renders the participant tiles and dismisses a just-opened Radix popover. In a fresh worker a single click then fails deterministically — and every CI retry runs in a fresh worker, so a first-attempt failure of this spec could never recover. Retry the open-and-read unit (open, title, toggle) until the menu holds through it. The underlying dismissal is a product bug worth its own look: an open agent-voice menu can be closed by background state settling the user never initiated. Signed-off-by: Max Lampert --- .../tests/e2e/huddle-transcription.spec.ts | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/desktop/tests/e2e/huddle-transcription.spec.ts b/desktop/tests/e2e/huddle-transcription.spec.ts index 7c56648654a..6d012249f89 100644 --- a/desktop/tests/e2e/huddle-transcription.spec.ts +++ b/desktop/tests/e2e/huddle-transcription.spec.ts @@ -811,17 +811,27 @@ test("assigns distinct agent voices and exposes compact per-agent controls", asy }); expect(new Set(assignedVoices).size).toBe(2); - await page.getByRole("button", { name: "Voice settings for alice" }).click(); - await waitForAnimations(page); const voiceMenu = page.locator( '[data-testid="huddle-agent-voice-menu-content"][data-state="open"]', ); - await expect(voiceMenu).toBeVisible(); - await expect( - voiceMenu.getByText("Agent text-to-speech", { exact: true }), - ).toBeVisible(); + // Shortly after a cold load, background huddle-state settling re-renders + // the tiles and dismisses a just-opened Radix menu; in a fresh worker + // (which is also every CI retry) a single click fails deterministically. + // Retry the whole open-and-read unit until the menu holds through it. const ttsToggle = voiceMenu.getByTestId("huddle-agent-tts-toggle"); - await expect(ttsToggle).toBeChecked(); + await expect(async () => { + if (!(await voiceMenu.isVisible())) { + await page + .getByRole("button", { name: "Voice settings for alice" }) + .click(); + } + await expect(voiceMenu).toBeVisible({ timeout: 1_500 }); + await expect( + voiceMenu.getByText("Agent text-to-speech", { exact: true }), + ).toBeVisible({ timeout: 1_500 }); + await expect(ttsToggle).toBeChecked({ timeout: 1_500 }); + }).toPass({ timeout: 20_000 }); + await waitForAnimations(page); await expect( voiceMenu.getByTestId("huddle-agent-voice-selector"), ).toContainText("Vera");