mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-20 12:11:28 -07:00
Add configurable keybinding to mark the current video as watched with IPC plumbing between renderer and main process. Add event listener infrastructure for tracking Yomitan dictionary lookups per session.
19 lines
598 B
TypeScript
19 lines
598 B
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { YOMITAN_LOOKUP_EVENT, registerYomitanLookupListener } from './yomitan-popup.js';
|
|
|
|
test('registerYomitanLookupListener forwards the SubMiner Yomitan lookup event', () => {
|
|
const target = new EventTarget();
|
|
const calls: string[] = [];
|
|
|
|
const dispose = registerYomitanLookupListener(target, () => {
|
|
calls.push('lookup');
|
|
});
|
|
|
|
target.dispatchEvent(new CustomEvent(YOMITAN_LOOKUP_EVENT));
|
|
dispose();
|
|
target.dispatchEvent(new CustomEvent(YOMITAN_LOOKUP_EVENT));
|
|
|
|
assert.deepEqual(calls, ['lookup']);
|
|
});
|