From dd197bdad8051ed4617e6c78ea0d8f4c6fc7a1e9 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 9 Nov 2026 06:03:21 +0000 Subject: [PATCH] test(ui-react): click, not check, a dictation choice the pane reverts (main red at 4d37694) The stale-revision and failed-save steps of the dictation selection runtime proof chose Beta with Playwright's check(), which clicks and then reads the radio back. The pane correctly reverts to Alpha when the fixture refuses the write, and when that revert commits first, check() throws "Clicking the checkbox did not change its state". Click instead: the following waits already assert the stale status and the save-failed alert with the reverted choice. Reproduced at 4d376943c under CPU load: 2 of 2 failing runs at line 472. With the fix: 10 of 10 passes of the case and the whole file under the same load. Refs #3759 Co-Authored-By: Claude Opus 5.5 --- packages/ui-react/tests/dictation-selection-runtime.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/ui-react/tests/dictation-selection-runtime.test.ts b/packages/ui-react/tests/dictation-selection-runtime.test.ts index 3d6055421b..3db16975d4 100644 --- a/packages/ui-react/tests/dictation-selection-runtime.test.ts +++ b/packages/ui-react/tests/dictation-selection-runtime.test.ts @@ -462,14 +462,16 @@ describe.skipIf(!executablePath)("Settings › Voice and the next take, against const pane = await settings(page); // Changed on another device twice: the value is back to alpha, the revision is not. await otherDevice("beta"); await otherDevice("alpha"); - await pane.getByRole("radio", { name: /^Beta Live/ }).check(); + // click, not check: the choice is refused and reverts, and `check()` + // fails when that revert lands before it reads the radio back (#3759). + await pane.getByRole("radio", { name: /^Beta Live/ }).click(); await page.getByText("Changed on another device. Showing the current choice.").waitFor(); expect(await pane.getByRole("radio", { name: /^Alpha Transcribe/ }).isChecked(), "the current value is reloaded").toBe(true); await shot(page, "stale-1280"); let fail = true; await page.route("**/api/voice/dictation/settings", (route) => route.request().method() === "PUT" && fail ? route.fulfill({ status: 500, json: { error: "Fixture failure" } }) : route.continue()); - await pane.getByRole("radio", { name: /^Beta Live/ }).check(); + await pane.getByRole("radio", { name: /^Beta Live/ }).click(); await pane.getByRole("alert").waitFor(); expect(await pane.getByRole("alert").textContent()).toContain("Couldn't save. Your dictation service is unchanged."); expect(await pane.getByRole("radio", { name: /^Alpha Transcribe/ }).isChecked(), "a failed save reverts").toBe(true);