mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix(e2e): code script broken due to codemirror update
This commit is contained in:
parent
1f57aaf27c
commit
cead31e08d
@ -7,18 +7,14 @@ test("Displays lint warnings for backend script", async ({ page, context }) => {
|
|||||||
await app.closeAllTabs();
|
await app.closeAllTabs();
|
||||||
await app.goToNoteInNewTab("Backend script with lint warnings");
|
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.
|
// 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 hello
|
// Hover over hello
|
||||||
await codeEditor.getByText("hello").first().hover();
|
await codeEditor.getByText("hello").first().hover();
|
||||||
await expectTooltip(page, "'hello' is defined but never used.");
|
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 }) => {
|
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.closeAllTabs();
|
||||||
await app.goToNoteInNewTab("Backend script with lint errors");
|
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.
|
// 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);
|
await expect(errorMarker).toHaveCount(1);
|
||||||
|
|
||||||
// Hover over hello
|
// Hover over hello
|
||||||
@ -40,7 +36,7 @@ test("Displays lint errors for backend script", async ({ page, context }) => {
|
|||||||
|
|
||||||
async function expectTooltip(page: Page, tooltip: string) {
|
async function expectTooltip(page: Page, tooltip: string) {
|
||||||
await expect(
|
await expect(
|
||||||
page.locator(".CodeMirror-lint-tooltip:visible", {
|
page.locator(".cm-tooltip:visible", {
|
||||||
hasText: tooltip
|
hasText: tooltip
|
||||||
})
|
})
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user