mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-26 00:55:16 -07:00
feat(macos): configuration window + curl-backed macOS updater (#71)
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { isConfigSettingsPatch } from './config-settings-ipc';
|
||||
import type { ConfigSettingsField } from '../../types/settings';
|
||||
|
||||
const fields: ConfigSettingsField[] = [
|
||||
{
|
||||
id: 'mpv.launchMode',
|
||||
label: 'Launch mode',
|
||||
description: 'Launch mode setting.',
|
||||
configPath: 'mpv.launchMode',
|
||||
category: 'playback-sources',
|
||||
section: 'mpv launcher',
|
||||
control: 'select',
|
||||
defaultValue: 'windowed',
|
||||
restartBehavior: 'restart',
|
||||
},
|
||||
];
|
||||
|
||||
test('isConfigSettingsPatch rejects set operations without a value property', () => {
|
||||
assert.equal(
|
||||
isConfigSettingsPatch(
|
||||
{
|
||||
operations: [{ op: 'set', path: 'mpv.launchMode' }],
|
||||
},
|
||||
fields,
|
||||
),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test('isConfigSettingsPatch accepts set operations with an explicit value', () => {
|
||||
assert.equal(
|
||||
isConfigSettingsPatch(
|
||||
{
|
||||
operations: [{ op: 'set', path: 'mpv.launchMode', value: 'fullscreen' }],
|
||||
},
|
||||
fields,
|
||||
),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test('isConfigSettingsPatch accepts reset operations without a value', () => {
|
||||
assert.equal(
|
||||
isConfigSettingsPatch(
|
||||
{
|
||||
operations: [{ op: 'reset', path: 'mpv.launchMode' }],
|
||||
},
|
||||
fields,
|
||||
),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test('isConfigSettingsPatch rejects unknown config paths', () => {
|
||||
assert.equal(
|
||||
isConfigSettingsPatch(
|
||||
{
|
||||
operations: [{ op: 'reset', path: 'unknown.path' }],
|
||||
},
|
||||
fields,
|
||||
),
|
||||
false,
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user