2024-02-19 03:41:50 -06:00
|
|
|
import { getAllUserDefaults } from '../src/app/plist-handler';
|
|
|
|
|
2024-11-20 02:09:33 -06:00
|
|
|
jest.mock('../src/app/config-handler', () => {
|
|
|
|
return {
|
|
|
|
ConfigFieldsDefaultValues: {},
|
|
|
|
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(),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2024-02-19 03:41:50 -06:00
|
|
|
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,
|
2024-02-22 02:29:19 -06:00
|
|
|
customFlags: {
|
2024-02-19 03:41:50 -06:00
|
|
|
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,
|
2024-02-22 02:29:19 -06:00
|
|
|
chromeFlags: undefined,
|
2024-03-21 01:03:06 -05:00
|
|
|
latestAutoUpdateChannelEnabled: undefined,
|
2024-02-19 03:41:50 -06:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|