mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-20 12:11:28 -07:00
feat: add mark-as-watched keybinding and Yomitan lookup tracking
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.
This commit is contained in:
18
src/renderer/yomitan-popup.test.ts
Normal file
18
src/renderer/yomitan-popup.test.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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']);
|
||||
});
|
||||
Reference in New Issue
Block a user