A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: fix e2e tests that download files
Abdullah Attaf60fc39ec09b
diff --git a/apps/web/__e2e__/utils/index.js b/apps/web/__e2e__/utils/index.jsindex daf80260f..e3d0a9d3d 100644--- a/apps/web/__e2e__/utils/index.js+++ b/apps/web/__e2e__/utils/index.js@@ -97,18 +97,14 @@ async function editNote(title, content, noDelay = false) {}async function downloadFile(downloadActionSelector, encoding) {- const promiseEvent = new Promise((resolve) => {- page.on("download", async (download) => {- const path = await download.path();- resolve(fs.readFileSync(path, { encoding }));- });- });-await page.waitForSelector(downloadActionSelector);- await page.click(downloadActionSelector);-- await promiseEvent;+ const [download] = await Promise.all([+ page.waitForEvent("download"),+ await page.click(downloadActionSelector)+ ]);+ const path = await download.path();+ return fs.readFileSync(path, { encoding });}async function getEditorTitle() {