-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcc0e76
commit db66998
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { test, expect, Page } from "@playwright/test"; | ||
import App from "../support/app"; | ||
|
||
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"); | ||
|
||
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); | ||
|
||
// Hover over hello | ||
await 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."); | ||
}); | ||
|
||
async function expectTooltip(page: Page, tooltip: string) { | ||
await expect(page.locator(".CodeMirror-lint-tooltip:visible", { | ||
"hasText": tooltip | ||
})).toBeVisible(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.