mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-11 04:46:07 -08:00
Overlay 2.0 (#12)
This commit is contained in:
1 parent
45df3c466b
commit
44c7761c7c
397 files changed
+15139
-7127
No files matched your search
@@ -2,10 +2,8 @@ import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { createOverlayWindowRuntimeHandlers } from './overlay-window-runtime-handlers';
|
||||
|
||||
test('overlay window runtime handlers compose create/main/invisible handlers', () => {
|
||||
test('overlay window runtime handlers compose create/main/modal handlers', () => {
|
||||
let mainWindow: { kind: string } | null = null;
|
||||
let invisibleWindow: { kind: string } | null = null;
|
||||
let secondaryWindow: { kind: string } | null = null;
|
||||
let modalWindow: { kind: string } | null = null;
|
||||
let debugEnabled = false;
|
||||
const calls: string[] = [];
|
||||
@@ -14,7 +12,6 @@ test('overlay window runtime handlers compose create/main/invisible handlers', (
|
||||
createOverlayWindowDeps: {
|
||||
createOverlayWindowCore: (kind) => ({ kind }),
|
||||
isDev: true,
|
||||
getOverlayDebugVisualizationEnabled: () => debugEnabled,
|
||||
ensureOverlayWindowLevel: () => calls.push('ensure-level'),
|
||||
onRuntimeOptionsChanged: () => calls.push('runtime-options-changed'),
|
||||
setOverlayDebugVisualizationEnabled: (enabled) => {
|
||||
@@ -27,29 +24,17 @@ test('overlay window runtime handlers compose create/main/invisible handlers', (
|
||||
setMainWindow: (window) => {
|
||||
mainWindow = window;
|
||||
},
|
||||
setInvisibleWindow: (window) => {
|
||||
invisibleWindow = window;
|
||||
},
|
||||
setSecondaryWindow: (window) => {
|
||||
secondaryWindow = window;
|
||||
},
|
||||
setModalWindow: (window) => {
|
||||
modalWindow = window;
|
||||
},
|
||||
});
|
||||
|
||||
assert.deepEqual(runtime.createOverlayWindow('visible'), { kind: 'visible' });
|
||||
assert.deepEqual(runtime.createOverlayWindow('invisible'), { kind: 'invisible' });
|
||||
assert.deepEqual(runtime.createOverlayWindow('secondary'), { kind: 'secondary' });
|
||||
assert.deepEqual(runtime.createOverlayWindow('modal'), { kind: 'modal' });
|
||||
|
||||
assert.deepEqual(runtime.createMainWindow(), { kind: 'visible' });
|
||||
assert.deepEqual(mainWindow, { kind: 'visible' });
|
||||
|
||||
assert.deepEqual(runtime.createInvisibleWindow(), { kind: 'invisible' });
|
||||
assert.deepEqual(invisibleWindow, { kind: 'invisible' });
|
||||
|
||||
assert.deepEqual(runtime.createSecondaryWindow(), { kind: 'secondary' });
|
||||
assert.deepEqual(secondaryWindow, { kind: 'secondary' });
|
||||
assert.deepEqual(runtime.createModalWindow(), { kind: 'modal' });
|
||||
assert.deepEqual(modalWindow, { kind: 'modal' });
|
||||
|
||||
|
||||
Reference in new issue
Block a user