mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-04 12:41:30 -07:00
Windows update (#49)
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { YOMITAN_LOOKUP_EVENT, registerYomitanLookupListener } from './yomitan-popup.js';
|
||||
import {
|
||||
YOMITAN_LOOKUP_EVENT,
|
||||
YOMITAN_POPUP_VISIBLE_HOST_SELECTOR,
|
||||
isYomitanPopupVisible,
|
||||
registerYomitanLookupListener,
|
||||
} from './yomitan-popup.js';
|
||||
|
||||
test('registerYomitanLookupListener forwards the SubMiner Yomitan lookup event', () => {
|
||||
const target = new EventTarget();
|
||||
@@ -16,3 +21,12 @@ test('registerYomitanLookupListener forwards the SubMiner Yomitan lookup event',
|
||||
|
||||
assert.deepEqual(calls, ['lookup']);
|
||||
});
|
||||
|
||||
test('isYomitanPopupVisible falls back to querySelector when querySelectorAll is unavailable', () => {
|
||||
const root = {
|
||||
querySelector: (selector: string) =>
|
||||
selector === YOMITAN_POPUP_VISIBLE_HOST_SELECTOR ? ({} as Element) : null,
|
||||
} as ParentNode;
|
||||
|
||||
assert.equal(isYomitanPopupVisible(root), true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user