From 7c9ce283319fc7b086f178b7c0800f2b55b84696 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Tue, 27 Jun 2023 13:23:57 +0530 Subject: [PATCH] chore: change filepath to memory --- src/utils/ipcCalls.ts | 2 +- uitest/index.mjs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/ipcCalls.ts b/src/utils/ipcCalls.ts index 5c821d5f..2882994e 100644 --- a/src/utils/ipcCalls.ts +++ b/src/utils/ipcCalls.ts @@ -141,7 +141,7 @@ export async function getSavePath(name: string, extention: string) { const canceled = response.canceled; let filePath = response.filePath; - if (filePath && !filePath.endsWith(extention)) { + if (filePath && !filePath.endsWith(extention) && filePath !== ':memory:') { filePath = `${filePath}.${extention}`; } diff --git a/uitest/index.mjs b/uitest/index.mjs index 0f291361..ed3c6cb9 100644 --- a/uitest/index.mjs +++ b/uitest/index.mjs @@ -44,11 +44,10 @@ const appSourcePath = path.join(root, 'dist_electron', 'build', 'main.js'); }); test('fill setup form', async (t) => { - const filePath = path.join(root, 'dbs', 'books_uitest.db'); await electronApp.evaluate(({ dialog }, filePath) => { dialog.showSaveDialog = () => Promise.resolve({ canceled: false, filePath }); - }, filePath); + }, ':memory:'); await window.getByTestId('create-new-file').click(); await window.getByTestId('submit-button').waitFor();