MM-60782 - use default download directory on windows (#3161)

* MM-60782 - use default download directory on windows

* fix unit tests
This commit is contained in:
Pablo Vélez
2024-10-18 15:39:56 +02:00
committed by GitHub
parent d047febb93
commit da88b8643e
12 changed files with 93 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ import MainWindow from '../windows/mainWindow';
jest.mock('electron', () => ({
app: {
getVersion: () => '5.0.0',
getPath: jest.fn(() => '/valid/downloads/path'),
},
BrowserView: jest.fn().mockImplementation(() => ({
webContents: {

View File

@@ -28,6 +28,7 @@ jest.mock('electron', () => {
return {
app: {
getAppPath: () => '',
getPath: jest.fn(() => '/valid/downloads/path'),
},
BrowserView: jest.fn().mockImplementation(() => ({
webContents: {

View File

@@ -36,6 +36,7 @@ jest.mock('electron', () => {
return {
app: {
getAppPath: () => '',
getPath: jest.fn(() => '/valid/downloads/path'),
},
BrowserView: jest.fn().mockImplementation(() => ({
webContents: {

View File

@@ -25,6 +25,9 @@ jest.mock('electron', () => ({
ipcMain: {
on: jest.fn(),
},
app: {
getPath: jest.fn(() => '/valid/downloads/path'),
},
}));
jest.mock('main/windows/mainWindow', () => ({
on: jest.fn(),

View File

@@ -18,6 +18,7 @@ import {ViewManager} from './viewManager';
jest.mock('electron', () => ({
app: {
getAppPath: () => '/path/to/app',
getPath: jest.fn(() => '/valid/downloads/path'),
},
dialog: {
showErrorBox: jest.fn(),