mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-27 00:55:16 -07:00
d673de75f6
- Replace subminer.conf plugin config with mpv.* fields in config.jsonc - Add socketPath, backend, autoStartSubMiner, pauseUntilOverlayReady, aniskipEnabled/buttonKey, subminerBinaryPath to mpv config - Add subtitleSidebar.css field; migrate legacy sidebar appearance fields - Add paintOrder and WebkitTextStroke to subtitle style options - Update default subtitle/sidebar fontFamily to CJK-first stack - Fix overlay visible state surviving mpv y-r restart - Fix live config saves applying subtitle CSS immediately to open overlays - Migrate legacy primary/secondary subtitle appearance into subtitleStyle.css on load - Switch AniSkip button key setting to click-to-learn key capture
50 lines
1.6 KiB
TypeScript
50 lines
1.6 KiB
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import * as ankiControls from './settings-anki-controls';
|
|
|
|
test('note field model preference prefers exact Kiku over configured model', () => {
|
|
assert.equal(
|
|
ankiControls.selectPreferredNoteFieldModelName(['Lapis Morph', 'Kiku'], 'Lapis Morph'),
|
|
'Kiku',
|
|
);
|
|
});
|
|
|
|
test('note field model preference ignores configured model case-insensitively', () => {
|
|
assert.equal(
|
|
ankiControls.selectPreferredNoteFieldModelName(['Lapis Morph', 'Kiku'], 'lapis morph'),
|
|
'Kiku',
|
|
);
|
|
});
|
|
|
|
test('note field model preference prefers exact Lapis when Kiku is unavailable', () => {
|
|
assert.equal(
|
|
ankiControls.selectPreferredNoteFieldModelName(['Mining', 'Lapis'], ''),
|
|
'Lapis',
|
|
);
|
|
});
|
|
|
|
test('note field model preference prefers exact Kiku over exact Lapis', () => {
|
|
assert.equal(ankiControls.selectPreferredNoteFieldModelName(['Lapis', 'Kiku'], ''), 'Kiku');
|
|
});
|
|
|
|
test('note field model preference does not treat partial Kiku matches as Kiku', () => {
|
|
assert.equal(
|
|
ankiControls.selectPreferredNoteFieldModelName(['Kikuchi', 'Lapis Morph'], 'Lapis Morph'),
|
|
'',
|
|
);
|
|
});
|
|
|
|
test('note field model preference does not treat partial Lapis matches as Lapis', () => {
|
|
assert.equal(
|
|
ankiControls.selectPreferredNoteFieldModelName(['Mining', 'Lapis Morph'], 'Lapis Morph'),
|
|
'',
|
|
);
|
|
});
|
|
|
|
test('note field model preference stays blank when no Kiku or Lapis note type exists', () => {
|
|
assert.equal(
|
|
ankiControls.selectPreferredNoteFieldModelName(['Basic', 'Mining'], 'Lapis Morph'),
|
|
'',
|
|
);
|
|
});
|