Skip to content

Commit

Permalink
SDA-4714 - Fix uts
Browse files Browse the repository at this point in the history
  • Loading branch information
KiranNiranjan committed Nov 15, 2024
1 parent e4800ea commit 44c7804
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/appMenu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { autoLaunchInstance } from '../src/app/auto-launch-controller';
import { config } from '../src/app/config-handler';
import { exportCrashDumps, exportLogs } from '../src/app/reports-handler';
import { updateAlwaysOnTop } from '../src/app/window-actions';
import { windowHandler } from '../src/app/window-handler';
import { zoomIn, zoomOut } from '../src/app/window-utils';
import { apiName } from '../src/common/api-interface';
import * as envMock from '../src/common/env';
import { logger } from '../src/common/logger';
import { BrowserWindow, dialog, session, shell } from './__mocks__/electron';
import { windowHandler } from '../src/app/window-handler';
import { apiName } from '../src/common/api-interface';

jest.mock('../src/app/stores', () => {
const mock = new Map<string, any>();
Expand Down
39 changes: 39 additions & 0 deletions spec/plistHandler.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
import { getAllUserDefaults } from '../src/app/plist-handler';

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(),
},
};
});

describe('Plist Handler', () => {
it('should return config object', () => {
expect(getAllUserDefaults()).toStrictEqual({
Expand Down

0 comments on commit 44c7804

Please sign in to comment.