Harden playlist browser test cleanup and keydown fixture

- Wrap injected global cleanup assertions in `try/finally`
- Return the post-append mutation snapshot before Ctrl+ArrowDown coverage
This commit is contained in:
2026-03-30 23:24:50 -07:00
parent ff760eaa32
commit 06708c9882
2 changed files with 12 additions and 6 deletions

View File

@@ -299,10 +299,12 @@ test('playlist browser test cleanup must delete injected globals that were origi
const env = setupPlaylistBrowserModalTest();
assert.equal(Object.prototype.hasOwnProperty.call(globalThis, 'window'), true);
assert.equal(Object.prototype.hasOwnProperty.call(globalThis, 'document'), true);
env.restore();
try {
assert.equal(Object.prototype.hasOwnProperty.call(globalThis, 'window'), true);
assert.equal(Object.prototype.hasOwnProperty.call(globalThis, 'document'), true);
} finally {
env.restore();
}
assert.equal(Object.prototype.hasOwnProperty.call(globalThis, 'window'), false);
assert.equal(Object.prototype.hasOwnProperty.call(globalThis, 'document'), false);
@@ -440,7 +442,7 @@ test('playlist browser modal keydown routes append, remove, reorder, tab switch,
notifyOverlayModalClosed: (modal: string) => notifications.push(`close:${modal}`),
appendPlaylistBrowserFile: async (filePath: string) => {
calls.push(['append', [filePath]]);
return { ok: true, message: 'append-ok', snapshot: createSnapshot() };
return { ok: true, message: 'append-ok', snapshot: createMutationSnapshot() };
},
playPlaylistBrowserIndex: async (index: number) => {
calls.push(['play', [index]]);