Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix tests

Abdullah Attaabb918e179a3
diff --git a/apps/web/__e2e__/models/app.model.ts b/apps/web/__e2e__/models/app.model.ts
index 0bdfa63f8..d27db453e 100644
--- a/apps/web/__e2e__/models/app.model.ts
+++ b/apps/web/__e2e__/models/app.model.ts
@@ -55,7 +55,7 @@ export class AppModel {
}
goBack() {
- const goBackButton = this.page.locator(getTestId("go-back"));
+ const goBackButton = this.page.locator(getTestId("route-go-back"));
return goBackButton.click();
}
diff --git a/apps/web/__e2e__/notehistory.test.ts b/apps/web/__e2e__/notehistory.test.ts
index ef30340e4..639ba5057 100644
--- a/apps/web/__e2e__/notehistory.test.ts
+++ b/apps/web/__e2e__/notehistory.test.ts
@@ -55,6 +55,7 @@ for (const type of sessionTypes) {
contents[1]
);
await note?.click();
+ if (type === "locked") await note?.openLockedNote(PASSWORD);
await note?.properties.close();
preview = await history?.at(0)?.open();
if (type === "locked") await preview?.unlock(PASSWORD);
diff --git a/apps/web/__e2e__/tabs.test.ts b/apps/web/__e2e__/tabs.test.ts
index 13a605120..3d242cd00 100644
--- a/apps/web/__e2e__/tabs.test.ts
+++ b/apps/web/__e2e__/tabs.test.ts
@@ -175,6 +175,7 @@ test("reloading with a note diff open in a tab", async ({ page }) => {
await preview!.firstEditor.waitFor({ state: "visible" });
await page.reload();
+ await preview!.firstEditor.waitFor({ state: "visible" });
await expect(preview!.firstEditor.locator(".ProseMirror")).toHaveText(
contents[0]
@@ -207,3 +208,6 @@ test("navigate back and forth between normal and diff session", async ({
contents[0]
);
});
+
+test.skip("TODO: open a locked note, switch to another note and navigate back", () => {});
+test.skip("TODO: open a locked note, switch to another note, unlock the note and navigate back", () => {});
diff --git a/apps/web/src/components/route-container/index.tsx b/apps/web/src/components/route-container/index.tsx
index f444190a9..269485344 100644
--- a/apps/web/src/components/route-container/index.tsx
+++ b/apps/web/src/components/route-container/index.tsx
@@ -140,7 +140,7 @@ function Header(props: RouteContainerProps) {
{buttons?.back ? (
<Button
{...buttons.back}
- data-test-id="go-back"
+ data-test-id="route-go-back"
sx={{ p: 0, flexShrink: 0 }}
>
<ArrowLeft size={20} />