From 8d026c8134baa50dcd415659afb0481614dbb250 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 17 Jan 2025 20:15:48 +0200 Subject: [PATCH] feat(e2e): basic test for note map rendering --- e2e/note_types/mindmap.spec.ts | 2 +- e2e/note_types/note_map.spec.ts | 9 +++++++++ e2e/support/app.ts | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 e2e/note_types/note_map.spec.ts diff --git a/e2e/note_types/mindmap.spec.ts b/e2e/note_types/mindmap.spec.ts index b06076cc3..9b3ca1907 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 000000000..46e81cef2 --- /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 290d9c420..231fac747 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"); }