Skip to content

Build your personal knowledge base with Trilium Notes

chore(e2e): test eslint errors

Elian Doran74b2643c283e
diff --git a/e2e/note_types/code.spec.ts b/e2e/note_types/code.spec.ts
index 31445e6db9..0317190c10 100644
--- a/e2e/note_types/code.spec.ts
+++ b/e2e/note_types/code.spec.ts
@@ -5,10 +5,9 @@ test("Displays lint warnings for backend script", async ({ page }) => {
const app = new App(page);
await app.goto();
await app.closeAllTabs();
- await app.goToNoteInNewTab("Backend script with lint warning");
+ await app.goToNoteInNewTab("Backend script with lint warnings");
const codeEditor = app.currentNoteSplit.locator(".CodeMirror");
- expect(await app.currentNoteSplit.locator(".note-title").inputValue()).toBe("Backend script with lint warnings");
// Expect two warning signs in the gutter.
expect(codeEditor.locator(".CodeMirror-gutter-wrapper .CodeMirror-lint-marker-warning")).toHaveCount(2);
@@ -22,6 +21,22 @@ test("Displays lint warnings for backend script", async ({ page }) => {
await expectTooltip(page, "'world' is defined but never used.");
});
+test("Displays lint errors for backend script", async ({ page }) => {
+ const app = new App(page);
+ await app.goto();
+ await app.closeAllTabs();
+ await app.goToNoteInNewTab("Backend script with lint errors");
+
+ const codeEditor = app.currentNoteSplit.locator(".CodeMirror");
+
+ // Expect two warning signs in the gutter.
+ expect(codeEditor.locator(".CodeMirror-gutter-wrapper .CodeMirror-lint-marker-error")).toHaveCount(1);
+
+ // Hover over hello
+ await codeEditor.getByText("world").first().hover();
+ await expectTooltip(page, "Parsing error: Unexpected token world");
+});
+
async function expectTooltip(page: Page, tooltip: string) {
await expect(page.locator(".CodeMirror-lint-tooltip:visible", {
"hasText": tooltip