Skip to content

Build your personal knowledge base with Trilium Notes

feat(e2e): basic test for note map rendering

Elian Doran8d026c8134ba
diff --git a/e2e/note_types/mindmap.spec.ts b/e2e/note_types/mindmap.spec.ts
index b06076cc36..9b3ca19070 100644
--- a/e2e/note_types/mindmap.spec.ts
+++ b/e2e/note_types/mindmap.spec.ts
@@ -1,4 +1,4 @@
-import { test, expect, Page } from "@playwright/test";
+import { test, expect } from "@playwright/test";
import App from "../support/app";
test("displays simple map", async ({ page, context }) => {
diff --git a/e2e/note_types/note_map.spec.ts b/e2e/note_types/note_map.spec.ts
new file mode 100644
index 0000000000..46e81cef25
--- /dev/null
+++ b/e2e/note_types/note_map.spec.ts
@@ -0,0 +1,9 @@
+import { test, expect } from "@playwright/test";
+import App from "../support/app";
+
+test("renders global map", async ({ page, context }) => {
+ const app = new App(page, context);
+ await app.goto();
+ await app.launcherBar.locator(".launcher-button.bx-map-alt").click();
+ await expect(app.currentNoteSplit.locator(".force-graph-container canvas")).toBeVisible();
+});
diff --git a/e2e/support/app.ts b/e2e/support/app.ts
index 290d9c4203..231fac7478 100644
--- a/e2e/support/app.ts
+++ b/e2e/support/app.ts
@@ -13,6 +13,7 @@ export default class App {
readonly tabBar: Locator;
readonly noteTree: Locator;
+ readonly launcherBar: Locator;
readonly currentNoteSplit: Locator;
readonly sidebar: Locator;
@@ -22,6 +23,7 @@ export default class App {
this.tabBar = page.locator(".tab-row-widget-container");
this.noteTree = page.locator(".tree-wrapper");
+ this.launcherBar = page.locator("#launcher-container");
this.currentNoteSplit = page.locator(".note-split:not(.hidden-ext)")
this.sidebar = page.locator("#right-pane");
}