Minimize and start Signal in tray

This commit is contained in:
Fedor Indutny 2022-09-06 15:09:52 -07:00 committed by GitHub
parent aa86d8bf82
commit b54c6f257d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 152 additions and 127 deletions

View file

@ -78,32 +78,32 @@ describe('SystemTraySettingCache', () => {
sinon.assert.notCalled(configSetStub);
});
it('returns DoNotUseSystemTray if system tray is supported but no preference is stored', async () => {
it('returns Uninitialized if system tray is supported but no preference is stored', async () => {
sandbox.stub(process, 'platform').value('win32');
const cache = new SystemTraySettingCache(sql, config, [], '1.2.3');
assert.strictEqual(await cache.get(), SystemTraySetting.DoNotUseSystemTray);
assert.strictEqual(await cache.get(), SystemTraySetting.Uninitialized);
assert(configGetStub.calledOnceWith('system-tray-setting'));
assert(
configSetStub.calledOnceWith(
'system-tray-setting',
SystemTraySetting.DoNotUseSystemTray
SystemTraySetting.Uninitialized
)
);
});
it('returns DoNotUseSystemTray if system tray is supported but the stored preference is invalid', async () => {
it('returns Uninitialized if system tray is supported but the stored preference is invalid', async () => {
sandbox.stub(process, 'platform').value('win32');
sqlCallStub.resolves({ value: 'garbage' });
const cache = new SystemTraySettingCache(sql, config, [], '1.2.3');
assert.strictEqual(await cache.get(), SystemTraySetting.DoNotUseSystemTray);
assert.strictEqual(await cache.get(), SystemTraySetting.Uninitialized);
assert(configGetStub.calledOnceWith('system-tray-setting'));
assert(
configSetStub.calledOnceWith(
'system-tray-setting',
SystemTraySetting.DoNotUseSystemTray
SystemTraySetting.Uninitialized
)
);
});