forked from nasa/earthdata-download
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.setup.js
53 lines (52 loc) · 1.61 KB
/
jest.setup.js
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
41
42
43
44
45
46
47
48
49
50
51
52
53
// Mock ResizeObserver for tests
global.ResizeObserver = jest.fn().mockImplementation(() => ({
observe: jest.fn(),
unobserve: jest.fn(),
disconnect: jest.fn()
}))
// Add a mock electronApi for App.test.js to correctly render context provider
window.electronApi = {
autoUpdateAvailable: jest.fn(),
autoUpdateInstallLater: jest.fn(),
autoUpdateProgress: jest.fn(),
autoUpdateError: jest.fn(),
beginDownload: jest.fn(),
cancelDownloadItem: jest.fn(),
cancelErroredDownloadItem: jest.fn(),
clearDownload: jest.fn(),
deleteDownloadHistory: jest.fn(),
chooseDownloadLocation: jest.fn(),
clearDefaultDownload: jest.fn(),
closeWindow: jest.fn(),
copyDownloadPath: jest.fn(),
deleteDownload: jest.fn(),
getPreferenceFieldValue: jest.fn(),
initializeDownload: jest.fn(),
maximizeWindow: jest.fn(),
minimizeWindow: jest.fn(),
openDownloadFolder: jest.fn(),
pauseDownloadItem: jest.fn(),
requestDownloadsProgress: jest.fn().mockResolvedValue({
downloadsReport: [],
totalDownloads: 0
}),
requestFilesProgress: jest.fn(),
restartDownload: jest.fn(),
resumeDownloadItem: jest.fn(),
retryErroredDownloadItem: jest.fn(),
sendToEula: jest.fn(),
sendToLogin: jest.fn(),
setDownloadLocation: jest.fn(),
setPendingDeleteDownloadHistory: jest.fn(),
setPreferenceFieldValue: jest.fn(),
setRestartingDownload: jest.fn(),
showWaitingForEulaDialog: jest.fn(),
showWaitingForLoginDialog: jest.fn(),
undoClearDownload: jest.fn(),
undoDeleteDownloadHistory: jest.fn(),
undoRestartingDownload: jest.fn(),
windowsLinuxTitleBar: jest.fn(),
isMac: true,
isWin: false,
isLinux: false
}