diff --git a/packages/ui-react/tests/browser/recordings-tray.offline.tsx b/packages/ui-react/tests/browser/recordings-tray.offline.tsx index ddbfc913af..bad3ddad1c 100644 --- a/packages/ui-react/tests/browser/recordings-tray.offline.tsx +++ b/packages/ui-react/tests/browser/recordings-tray.offline.tsx @@ -21,6 +21,7 @@ import { installFaultNetwork } from "./offline/fault-network.ts"; import { installWavMicrophone, watchMicrophone } from "./offline/fake-microphone.ts"; import { generateWav, AUDIO_FIXTURES } from "./offline/audio-fixtures.ts"; import { describeHit, touchFloor } from "./hit-reach.js"; +import { deepgramDiscovery } from "../fixtures/dictation-discovery.js"; const TEXT = "Ask Penelope whether the loom order arrived."; const wait = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms)); @@ -146,6 +147,10 @@ for (const theme of ["dark", "light"]) for (const width of [320, 390, 900, 1280] expect(c.host.querySelector('[aria-label="Scroll to latest"]'), "reading mode disabled tailing").not.toBeNull(); const anchor = [...c.host.querySelectorAll("[data-transcript-anchor]")].find(el => el.getBoundingClientRect().bottom > scroller.getBoundingClientRect().top)!; const top = anchor.getBoundingClientRect().top; + // The tray's Transcribe control waits on dictation discovery (#3709). Known + // up front, it renders with the tray, so this measures the tray appearing + // rather than a later discovery answer growing it. + c.root.stores.voice.setState({ discovery: { snapshot: deepgramDiscovery(false), at: Date.now() + 24 * 60 * 60_000 } }); const requestsBefore = c.net.requests.length; const framesBefore = c.net.frames.length; const row = await c.seed("interrupted"); const card = await c.seed("transcript-ready", TEXT, "2026-07-12T09:00:00"); diff --git a/packages/ui-react/tests/fixtures/dictation-selection-client.tsx b/packages/ui-react/tests/fixtures/dictation-selection-client.tsx index dc92f44c0a..f7ff2feb2b 100644 --- a/packages/ui-react/tests/fixtures/dictation-selection-client.tsx +++ b/packages/ui-react/tests/fixtures/dictation-selection-client.tsx @@ -33,10 +33,12 @@ Object.assign(window, { root.stores.connection.getState().setVpnStatus("connected", probe.accountKey ?? null); await root.localWork!.restoring(); const sink = root.recordings!.sink(); - // The mounted tray's recovery holds the recording lock for a moment. + // The mounted tray's recovery, or the previous seed's capture still + // releasing, holds the recording lock for a moment. This page is the + // only tab, so either refusal names a hold of its own. for (let attempt = 0; ; attempt++) { try { await sink.begin!({ mimeType: "audio/webm;codecs=opus" }); break; } - catch (error) { if (attempt > 50 || !String(error).includes("still being checked")) throw error; await new Promise((resolve) => setTimeout(resolve, 100)); } + catch (error) { if (attempt > 50 || !/still being checked|Recording in another Brain tab/.test(String(error))) throw error; await new Promise((resolve) => setTimeout(resolve, 100)); } } await sink.chunk({ index: 0, startMs: 0, endMs: 1000, data: new Blob([new Uint8Array([0x1a, 0x45, 0xdf, 0xa3, 1, 2, 3])]) }); await sink.end!("user"); diff --git a/packages/ui-react/tests/fixtures/parallel-sessions-client.tsx b/packages/ui-react/tests/fixtures/parallel-sessions-client.tsx index f49ead6a7a..87d0854bea 100644 --- a/packages/ui-react/tests/fixtures/parallel-sessions-client.tsx +++ b/packages/ui-react/tests/fixtures/parallel-sessions-client.tsx @@ -80,6 +80,8 @@ Object.assign(window, { .map((v) => ({ sessionId: v.sessionId, state: v.state, pendingKind: v.pendingKind, cleared: v.cleared, turnId: v.turnId, settled: v.settled })), records: () => root.stores.trackers.getState().records, spoken: () => [...spoken], + /** The title the session list holds for a session, which labels its announcements. */ + listedTitle: (sessionId: string) => root.stores.sessions.getState().sessions.find((s) => s.id === sessionId)?.title ?? null, draft: () => { const drafts = root.stores.drafts.getState(); const d = drafts.drafts[drafts.idFor(root.stores.chat.getState().activeSessionId)]; diff --git a/packages/ui-react/tests/parallel-sessions-runtime.test.ts b/packages/ui-react/tests/parallel-sessions-runtime.test.ts index 3eeae005f5..0ecc4a4c4d 100644 --- a/packages/ui-react/tests/parallel-sessions-runtime.test.ts +++ b/packages/ui-react/tests/parallel-sessions-runtime.test.ts @@ -714,7 +714,10 @@ describe.skipIf(!executablePath)("mounted parallel sessions", () => { expect((await drawn(run, a.page)).sort(), "both drawn").toEqual([A, B].sort()); await neverDone(run, a.page, [A, B]); - // B fails unwatched: failed, and announced once. + // B fails unwatched: failed, and announced once. The announcement is + // labelled from the session list, so wait until the list has read B's + // host title; before that the label falls back to B's first prompt. + await until(a.page, `p.listedTitle(${JSON.stringify(B)}) === ${JSON.stringify(titles.get(B))}`); await release(pb, "fail"); await until(a.page, `${state(B)}?.state === "failed"`); await until(a.page, "p.spoken().length >= 1");