mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-30 17:40:53 -07:00
feat(overlay): run session help commands with Enter or double-click (#275)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { IPC_CHANNELS } from '../../shared/ipc/contracts';
|
||||
import { openSessionHelpModal } from './session-help-open';
|
||||
|
||||
test('session help open tells the renderer whether commands can run', async () => {
|
||||
for (const playing of [true, false]) {
|
||||
const sent: Array<{ channel: string; payload: unknown }> = [];
|
||||
const opened = await openSessionHelpModal({
|
||||
ensureOverlayStartupPrereqs: () => {},
|
||||
ensureOverlayWindowsReadyForVisibilityActions: () => {},
|
||||
sendToActiveOverlayWindow: (channel, payload) => {
|
||||
sent.push({ channel, payload });
|
||||
return true;
|
||||
},
|
||||
waitForModalOpen: async () => true,
|
||||
logWarn: () => {},
|
||||
isMediaPlaybackActive: () => playing,
|
||||
});
|
||||
|
||||
assert.equal(opened, true);
|
||||
assert.deepEqual(sent, [
|
||||
{ channel: IPC_CHANNELS.event.sessionHelpOpen, payload: { commandsEnabled: playing } },
|
||||
]);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user