mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-01 06:12:07 -07:00
29 lines
952 B
TypeScript
29 lines
952 B
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { IPC_CHANNELS } from '../../shared/ipc/contracts';
|
|
import { openPlaylistBrowser } from './playlist-browser-open';
|
|
|
|
test('playlist browser open bootstraps overlay runtime before dispatching the modal event', () => {
|
|
const calls: string[] = [];
|
|
|
|
const opened = openPlaylistBrowser({
|
|
ensureOverlayStartupPrereqs: () => {
|
|
calls.push('prereqs');
|
|
},
|
|
ensureOverlayWindowsReadyForVisibilityActions: () => {
|
|
calls.push('windows');
|
|
},
|
|
sendToActiveOverlayWindow: (channel, payload, runtimeOptions) => {
|
|
calls.push(`send:${channel}`);
|
|
assert.equal(payload, undefined);
|
|
assert.deepEqual(runtimeOptions, {
|
|
restoreOnModalClose: 'playlist-browser',
|
|
});
|
|
return true;
|
|
},
|
|
});
|
|
|
|
assert.equal(opened, true);
|
|
assert.deepEqual(calls, ['prereqs', 'windows', `send:${IPC_CHANNELS.event.playlistBrowserOpen}`]);
|
|
});
|