-
Notifications
You must be signed in to change notification settings - Fork 283
Expand file tree
/
Copy pathconfig.test.ts
More file actions
40 lines (33 loc) · 1.29 KB
/
config.test.ts
File metadata and controls
40 lines (33 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Paths, WindowConfig } from './config';
vi.mock('./utils', () => ({
isDevMode: vi.fn().mockReturnValue(false),
}));
vi.mock('electron', () => ({
app: {
isPackaged: true,
},
}));
describe('main/config.ts', () => {
it('exports Paths object with expected properties', () => {
expect(Paths.preload).toBeDefined();
expect(Paths.preload).toContain('preload.js');
expect(Paths.indexHtml).toBeDefined();
expect(Paths.indexHtml).toContain('index.html');
expect(Paths.notificationSound).toBeDefined();
expect(Paths.notificationSound).toContain('.mp3');
expect(Paths.twemojiFolder).toBeDefined();
expect(Paths.twemojiFolder).toContain('twemoji');
});
it('exports WindowConfig with expected properties', () => {
expect(WindowConfig.width).toBe(500);
expect(WindowConfig.height).toBe(400);
expect(WindowConfig.minWidth).toBe(500);
expect(WindowConfig.minHeight).toBe(400);
expect(WindowConfig.resizable).toBe(false);
expect(WindowConfig.skipTaskbar).toBe(true);
expect(WindowConfig.webPreferences).toBeDefined();
expect(WindowConfig.webPreferences?.contextIsolation).toBe(true);
expect(WindowConfig.webPreferences?.nodeIntegration).toBe(false);
expect(WindowConfig.webPreferences?.backgroundThrottling).toBe(false);
});
});