mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
SDA-4476 - Add // nosemgrep (#2096)
SDA-4476 - Add installVariant to defaults
SDA-4476 - Initialize plist file
Revert "Revert "SDA-4472 (Migrate Symphony.config & installVariant into /Library/Preference) (#2090)" (#2094)"
This reverts commit 0aeee5b7a3.
This commit is contained in:
@@ -290,6 +290,10 @@ export const screen = {
|
||||
}),
|
||||
};
|
||||
|
||||
export const systemPreferences = {
|
||||
getUserDefault: jest.fn(),
|
||||
};
|
||||
|
||||
export const remote = {
|
||||
app,
|
||||
getCurrentWindow,
|
||||
|
||||
@@ -60,6 +60,10 @@ jest.mock('../src/app/auto-update-handler', () => {
|
||||
return {};
|
||||
});
|
||||
|
||||
jest.mock('../src/app/config-handler', () => {
|
||||
return {};
|
||||
});
|
||||
|
||||
describe('child window handle', () => {
|
||||
it('should set open window handler', () => {
|
||||
const spy = jest.spyOn(webContents, 'setWindowOpenHandler');
|
||||
|
||||
@@ -39,6 +39,47 @@ jest.mock('../src/app/window-handler', () => {
|
||||
};
|
||||
});
|
||||
|
||||
jest.mock('../src/app/plist-handler', () => {
|
||||
return {};
|
||||
});
|
||||
jest.mock('../src/app/config-handler', () => {
|
||||
return {
|
||||
CloudConfigDataTypes: {
|
||||
NOT_SET: 'NOT_SET',
|
||||
ENABLED: 'ENABLED',
|
||||
DISABLED: 'DISABLED',
|
||||
},
|
||||
config: {
|
||||
getConfigFields: jest.fn(() => {
|
||||
return {
|
||||
minimizeOnClose: 'ENABLED',
|
||||
launchOnStartup: 'ENABLED',
|
||||
alwaysOnTop: 'ENABLED',
|
||||
isAlwaysOnTop: 'ENABLED',
|
||||
bringToFront: 'ENABLED',
|
||||
devToolsEnabled: true,
|
||||
};
|
||||
}),
|
||||
getGlobalConfigFields: jest.fn(() => {
|
||||
return {
|
||||
devToolsEnabled: true,
|
||||
};
|
||||
}),
|
||||
getFilteredCloudConfigFields: jest.fn(() => {
|
||||
return {
|
||||
devToolsEnabled: true,
|
||||
};
|
||||
}),
|
||||
getCloudConfigFields: jest.fn(() => {
|
||||
return {
|
||||
devToolsEnabled: true,
|
||||
};
|
||||
}),
|
||||
updateUserConfig: jest.fn(),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
jest.mock('../src/renderer/notification', () => {
|
||||
return {
|
||||
setupNotificationPosition: jest.fn(),
|
||||
|
||||
54
spec/plistHandler.spec.ts
Normal file
54
spec/plistHandler.spec.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { getAllUserDefaults } from '../src/app/plist-handler';
|
||||
|
||||
describe('Plist Handler', () => {
|
||||
it('should return config object', () => {
|
||||
expect(getAllUserDefaults()).toStrictEqual({
|
||||
alwaysOnTop: undefined,
|
||||
autoLaunchPath: undefined,
|
||||
autoUpdateChannel: undefined,
|
||||
autoUpdateCheckInterval: undefined,
|
||||
autoUpdateUrl: undefined,
|
||||
betaAutoUpdateChannelEnabled: undefined,
|
||||
bringToFront: undefined,
|
||||
browserLoginAutoConnect: undefined,
|
||||
chromeFlags: {
|
||||
authNegotiateDelegateWhitelist: undefined,
|
||||
authServerWhitelist: undefined,
|
||||
disableThrottling: undefined,
|
||||
},
|
||||
contextIsolation: undefined,
|
||||
contextOriginUrl: undefined,
|
||||
ctWhitelist: undefined,
|
||||
devToolsEnabled: undefined,
|
||||
disableGpu: undefined,
|
||||
enableBrowserLogin: undefined,
|
||||
enableRendererLogs: undefined,
|
||||
forceAutoUpdate: undefined,
|
||||
isAutoUpdateEnabled: undefined,
|
||||
isCustomTitleBar: undefined,
|
||||
isPodUrlEditable: undefined,
|
||||
launchOnStartup: undefined,
|
||||
memoryRefresh: undefined,
|
||||
memoryThreshold: undefined,
|
||||
minimizeOnClose: undefined,
|
||||
notificationSettings: {
|
||||
display: undefined,
|
||||
position: undefined,
|
||||
},
|
||||
overrideUserAgent: undefined,
|
||||
permissions: {
|
||||
fullscreen: undefined,
|
||||
geolocation: undefined,
|
||||
media: undefined,
|
||||
midiSysex: undefined,
|
||||
notifications: undefined,
|
||||
openExternal: undefined,
|
||||
pointerLock: undefined,
|
||||
},
|
||||
podWhitelist: undefined,
|
||||
url: undefined,
|
||||
userDataPath: undefined,
|
||||
whitelistUrl: undefined,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user