From 86839619675c42e4805ff9ee5b8bafb1a4765e34 Mon Sep 17 00:00:00 2001 From: sudacode Date: Tue, 4 Aug 2026 02:53:33 -0700 Subject: [PATCH] placeholder {"subject": "test(subtitles): fix tests for provisional emit and payload signature", "body": "- Expect the provisional plain-text emit alongside the refresh's empty emit\n- Match emitSubtitlePayload regex against its updated parameter signature"} --- src/core/services/subtitle-processing-controller.test.ts | 4 +++- src/main/main-wiring.test.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/services/subtitle-processing-controller.test.ts b/src/core/services/subtitle-processing-controller.test.ts index a64fb5c4..0453b93d 100644 --- a/src/core/services/subtitle-processing-controller.test.ts +++ b/src/core/services/subtitle-processing-controller.test.ts @@ -585,9 +585,11 @@ test('refreshCurrentSubtitle reports the empty-text emit that an in-flight run w resolveFirst?.({ text: '字幕', tokens: [] }); await flushMicrotasks(); await flushMicrotasks(); + // '字幕' is the provisional plain emit the in-flight run already made before + // the refresh; '' is the emit the refresh promised. assert.deepEqual( emitted.map((payload) => payload.text), - [''], + ['字幕', ''], ); }); diff --git a/src/main/main-wiring.test.ts b/src/main/main-wiring.test.ts index d7599cc1..82beb5a6 100644 --- a/src/main/main-wiring.test.ts +++ b/src/main/main-wiring.test.ts @@ -620,7 +620,7 @@ test('subtitle broadcasts share one frequency options snapshot per emitted paylo test('annotation upgrades skip the duplicate basic websocket event', () => { const source = readMainSource(); const emitBlock = source.match( - /function emitSubtitlePayload\(payload: SubtitleData\): void \{(?[\s\S]*?)\n\}/, + /function emitSubtitlePayload\([\s\S]*?\): void \{(?[\s\S]*?)\n\}/, )?.groups?.body; assert.ok(emitBlock);