Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(e2e): code script broken due to codemirror update
Elian Dorancead31e08d5b
diff --git a/apps/server-e2e/src/note_types/code.spec.ts b/apps/server-e2e/src/note_types/code.spec.tsindex 29084ff84d..325c6100b0 100644--- a/apps/server-e2e/src/note_types/code.spec.ts+++ b/apps/server-e2e/src/note_types/code.spec.ts@@ -7,18 +7,14 @@ test("Displays lint warnings for backend script", async ({ page, context }) => {await app.closeAllTabs();await app.goToNoteInNewTab("Backend script with lint warnings");- const codeEditor = app.currentNoteSplit.locator(".CodeMirror");+ const codeEditor = app.currentNoteSplit.locator(".cm-editor");// Expect two warning signs in the gutter.- await expect(codeEditor.locator(".CodeMirror-gutter-wrapper .CodeMirror-lint-marker-warning")).toHaveCount(2);+ await expect(codeEditor.locator(".cm-gutter-lint .cm-lint-marker-warning")).toHaveCount(2);// Hover over helloawait codeEditor.getByText("hello").first().hover();await expectTooltip(page, "'hello' is defined but never used.");-- // Hover over world- await codeEditor.getByText("world").first().hover();- await expectTooltip(page, "'world' is defined but never used.");});test("Displays lint errors for backend script", async ({ page, context }) => {@@ -27,10 +23,10 @@ test("Displays lint errors for backend script", async ({ page, context }) => {await app.closeAllTabs();await app.goToNoteInNewTab("Backend script with lint errors");- const codeEditor = app.currentNoteSplit.locator(".CodeMirror");+ const codeEditor = app.currentNoteSplit.locator(".cm-editor");// Expect two warning signs in the gutter.- const errorMarker = codeEditor.locator(".CodeMirror-gutter-wrapper .CodeMirror-lint-marker-error");+ const errorMarker = codeEditor.locator(".cm-gutter-lint .cm-lint-marker-error");await expect(errorMarker).toHaveCount(1);// Hover over hello@@ -40,7 +36,7 @@ test("Displays lint errors for backend script", async ({ page, context }) => {async function expectTooltip(page: Page, tooltip: string) {await expect(- page.locator(".CodeMirror-lint-tooltip:visible", {+ page.locator(".cm-tooltip:visible", {hasText: tooltip})).toBeVisible();