mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-16 13:55:51 -07:00
feat: add auto update support
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { shouldEnsureTrayOnStartupForInitialArgs } from './startup-tray-policy';
|
||||
import {
|
||||
shouldEnsureTrayOnStartupForInitialArgs,
|
||||
shouldQuitOnWindowAllClosedForTrayState,
|
||||
} from './startup-tray-policy';
|
||||
|
||||
test('startup tray policy enables tray on Windows by default', () => {
|
||||
assert.equal(shouldEnsureTrayOnStartupForInitialArgs('win32', null), true);
|
||||
@@ -18,3 +21,24 @@ test('startup tray policy skips tray for direct youtube playback on Windows', ()
|
||||
test('startup tray policy skips tray outside Windows', () => {
|
||||
assert.equal(shouldEnsureTrayOnStartupForInitialArgs('linux', null), false);
|
||||
});
|
||||
|
||||
test('window-all-closed keeps tray-resident app alive', () => {
|
||||
assert.equal(
|
||||
shouldQuitOnWindowAllClosedForTrayState({ backgroundMode: false, hasTray: true }),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
test('window-all-closed quits non-background app without tray', () => {
|
||||
assert.equal(
|
||||
shouldQuitOnWindowAllClosedForTrayState({ backgroundMode: false, hasTray: false }),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test('window-all-closed keeps background app alive without tray', () => {
|
||||
assert.equal(
|
||||
shouldQuitOnWindowAllClosedForTrayState({ backgroundMode: true, hasTray: false }),
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user