mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-28 18:22:42 -08:00
feat(core): add Electron runtime, services, and app composition
This commit is contained in:
49
src/main/runtime/overlay-shortcuts-lifecycle.test.ts
Normal file
49
src/main/runtime/overlay-shortcuts-lifecycle.test.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {
|
||||
createRefreshOverlayShortcutsHandler,
|
||||
createRegisterOverlayShortcutsHandler,
|
||||
createSyncOverlayShortcutsHandler,
|
||||
createUnregisterOverlayShortcutsHandler,
|
||||
} from './overlay-shortcuts-lifecycle';
|
||||
|
||||
function createRuntime(calls: string[]) {
|
||||
return {
|
||||
registerOverlayShortcuts: () => calls.push('register'),
|
||||
unregisterOverlayShortcuts: () => calls.push('unregister'),
|
||||
syncOverlayShortcuts: () => calls.push('sync'),
|
||||
refreshOverlayShortcuts: () => calls.push('refresh'),
|
||||
};
|
||||
}
|
||||
|
||||
test('register overlay shortcuts handler delegates to runtime', () => {
|
||||
const calls: string[] = [];
|
||||
createRegisterOverlayShortcutsHandler({
|
||||
overlayShortcutsRuntime: createRuntime(calls),
|
||||
})();
|
||||
assert.deepEqual(calls, ['register']);
|
||||
});
|
||||
|
||||
test('unregister overlay shortcuts handler delegates to runtime', () => {
|
||||
const calls: string[] = [];
|
||||
createUnregisterOverlayShortcutsHandler({
|
||||
overlayShortcutsRuntime: createRuntime(calls),
|
||||
})();
|
||||
assert.deepEqual(calls, ['unregister']);
|
||||
});
|
||||
|
||||
test('sync overlay shortcuts handler delegates to runtime', () => {
|
||||
const calls: string[] = [];
|
||||
createSyncOverlayShortcutsHandler({
|
||||
overlayShortcutsRuntime: createRuntime(calls),
|
||||
})();
|
||||
assert.deepEqual(calls, ['sync']);
|
||||
});
|
||||
|
||||
test('refresh overlay shortcuts handler delegates to runtime', () => {
|
||||
const calls: string[] = [];
|
||||
createRefreshOverlayShortcutsHandler({
|
||||
overlayShortcutsRuntime: createRuntime(calls),
|
||||
})();
|
||||
assert.deepEqual(calls, ['refresh']);
|
||||
});
|
||||
Reference in New Issue
Block a user