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"}
This commit is contained in:
2026-08-04 02:53:33 -07:00
parent c9baaeea17
commit 8683961967
2 changed files with 4 additions and 2 deletions
@@ -585,9 +585,11 @@ test('refreshCurrentSubtitle reports the empty-text emit that an in-flight run w
resolveFirst?.({ text: '字幕', tokens: [] }); resolveFirst?.({ text: '字幕', tokens: [] });
await flushMicrotasks(); await flushMicrotasks();
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( assert.deepEqual(
emitted.map((payload) => payload.text), emitted.map((payload) => payload.text),
[''], ['字幕', ''],
); );
}); });
+1 -1
View File
@@ -620,7 +620,7 @@ test('subtitle broadcasts share one frequency options snapshot per emitted paylo
test('annotation upgrades skip the duplicate basic websocket event', () => { test('annotation upgrades skip the duplicate basic websocket event', () => {
const source = readMainSource(); const source = readMainSource();
const emitBlock = source.match( const emitBlock = source.match(
/function emitSubtitlePayload\(payload: SubtitleData\): void \{(?<body>[\s\S]*?)\n\}/, /function emitSubtitlePayload\([\s\S]*?\): void \{(?<body>[\s\S]*?)\n\}/,
)?.groups?.body; )?.groups?.body;
assert.ok(emitBlock); assert.ok(emitBlock);