mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-28 18:22:42 -08:00
29 lines
956 B
TypeScript
29 lines
956 B
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { createRuntimeOptionsIpcDepsRuntimeService } from "./runtime-options-ipc-deps-runtime-service";
|
|
|
|
test("createRuntimeOptionsIpcDepsRuntimeService delegates set/cycle with osd", () => {
|
|
const osd: string[] = [];
|
|
const deps = createRuntimeOptionsIpcDepsRuntimeService({
|
|
getRuntimeOptionsManager: () => ({
|
|
setOptionValue: () => ({ ok: true, osdMessage: "set ok" }),
|
|
cycleOption: () => ({ ok: true, osdMessage: "cycle ok" }),
|
|
}),
|
|
showMpvOsd: (text) => {
|
|
osd.push(text);
|
|
},
|
|
});
|
|
|
|
const setResult = deps.setRuntimeOption("subtitles.secondaryMode", "hidden") as {
|
|
ok: boolean;
|
|
};
|
|
const cycleResult = deps.cycleRuntimeOption("subtitles.secondaryMode", 1) as {
|
|
ok: boolean;
|
|
};
|
|
|
|
assert.equal(setResult.ok, true);
|
|
assert.equal(cycleResult.ok, true);
|
|
assert.ok(osd.includes("set ok"));
|
|
assert.ok(osd.includes("cycle ok"));
|
|
});
|