Skip to content

Commit 6838058

Browse files
thymikeeclaude
andcommitted
test(record): refuse every second playability check in the finalizer regression
The stub refused a second check only when handed the spent budget, so the base form of that check, which passed no deadline, would have read playable and passed. The stub now refuses any check, and the test asserts none ran. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3a127d3 commit 6838058

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/platform-runtime-screen-recording-finalizer-host.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,11 @@ test('the overlay budget covers the playability checks that run before the overl
132132

133133
test('a recording confirmed playable as the budget runs out is not refused by a second check', async () => {
134134
// A check after the budget is spent reads as not playable, so the finalizer decides on the
135-
// verdict of the wait that confirmed the file rather than asking again.
135+
// verdict of the wait that confirmed the file rather than asking again. Any second check, with
136+
// the spent budget or without one, refuses here.
136137
vi.useFakeTimers({ toFake: ['Date'] });
137138
try {
138-
video.isPlayable.mockImplementation(async (_path, _host, deadline) => !deadline?.isExpired());
139+
video.isPlayable.mockResolvedValue(false);
139140
video.playable.mockImplementationOnce(async () => {
140141
vi.setSystemTime(Date.now() + OVERLAY_BUDGET_MS);
141142
return true;
@@ -149,6 +150,7 @@ test('a recording confirmed playable as the budget runs out is not refused by a
149150
targetLabel: 'test recording',
150151
}),
151152
).resolves.toEqual({ telemetryPath: '/tmp/capture.telemetry.json' });
153+
expect(video.isPlayable).not.toHaveBeenCalled();
152154
} finally {
153155
vi.useRealTimers();
154156
}

0 commit comments

Comments
 (0)