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 backup tests
Abdullah Attaa4f50fa2c30d
diff --git a/apps/web/__e2e__/backups.test.ts b/apps/web/__e2e__/backups.test.tsindex 23ba6051d..667c21d8d 100644--- a/apps/web/__e2e__/backups.test.ts+++ b/apps/web/__e2e__/backups.test.ts@@ -18,21 +18,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.*/import { test, expect } from "@playwright/test";import { AppModel } from "./models/app.model";-import { NOTE, USER } from "./utils";+import { USER } from "./utils";-test("create a backup", async ({ page }) => {+test("create an unencrypted backup", async ({ page }) => {const app = new AppModel(page);- await app.goto();- const notes = await app.goToNotes();- await notes.createNote(NOTE);+ await app.auth.goto();+ await app.auth.login(USER.CURRENT);const settings = await app.goToSettings();+ await settings.toggleBackupEncryption(USER.CURRENT.password);- const backup = await settings.createBackup();+ const backup = await settings.createBackup(USER.CURRENT.password);expect(backup.length > 0).toBeTruthy();});-test("restore a backup", async ({ page }) => {+test("restore an unencrypted backup", async ({ page }) => {const app = new AppModel(page);await app.goto();const settings = await app.goToSettings();@@ -56,7 +56,7 @@ test("create an encrypted backup", async ({ page }, info) => {await app.auth.login(USER.CURRENT);const settings = await app.goToSettings();- const backup = await settings.createBackup(USER.CURRENT.password);+ const backup = await settings.createBackup();expect(backup.length > 0).toBeTruthy();});diff --git a/apps/web/src/common/index.ts b/apps/web/src/common/index.tsindex 858374c73..9fbcb7f5e 100644--- a/apps/web/src/common/index.ts+++ b/apps/web/src/common/index.ts@@ -157,6 +157,7 @@ export async function restoreBackupFile(backupFile: File) {} else {await restoreWithProgress(backup);}+ await db.initCollections();} else {const error = await TaskManager.startTask<Error | void>({title: "Restoring backup",