1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/app-desktop/integration-tests/util/setFilePickerResponse.ts

14 lines
404 B
TypeScript

import { ElectronApplication } from '@playwright/test';
const setFilePickerResponse = (electronApp: ElectronApplication, response: string[]) => {
return electronApp.evaluate(async ({ dialog }, response) => {
dialog.showOpenDialog = async () => ({
canceled: false,
filePaths: response,
});
dialog.showOpenDialogSync = () => response;
}, response);
};
export default setFilePickerResponse;