mirror of
https://github.com/heyman/heynote.git
synced 2024-12-03 05:14:59 +01:00
acb7ddf189
* Add support for opening settings dialog in the webapp * Add tests for settings dialog * Hide stand-alone app specific settings in web app * Remove debug log
41 lines
1.7 KiB
JavaScript
41 lines
1.7 KiB
JavaScript
import { test, expect } from "@playwright/test";
|
|
import { HeynotePage } from "./test-utils.js";
|
|
|
|
let heynotePage
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
heynotePage = new HeynotePage(page)
|
|
await heynotePage.goto()
|
|
});
|
|
|
|
|
|
test("test open settings dialog", async ({ page }) => {
|
|
await page.locator("css=.status-block.settings").click()
|
|
await expect(page.locator("css=.overlay .settings .dialog")).toBeVisible()
|
|
})
|
|
|
|
test("test close settings dialog", async ({ page }) => {
|
|
await page.locator("css=.status-block.settings").click()
|
|
await page.locator("css=.overlay .settings .dialog .bottom-bar .close").click()
|
|
await expect(page.locator("css=.overlay .settings .dialog")).not.toBeVisible()
|
|
})
|
|
|
|
test("test close settings dialog with escape", async ({ page }) => {
|
|
await page.locator("css=.status-block.settings").click()
|
|
await page.locator("body").press("Escape")
|
|
await expect(page.locator("css=.overlay .settings .dialog")).not.toBeVisible()
|
|
})
|
|
|
|
test("test change line gutter setting", async ({ page }) => {
|
|
await expect(page.locator("css=.cm-lineNumbers")).toBeVisible()
|
|
await page.locator("css=.status-block.settings").click()
|
|
await page.locator("css=.overlay .settings .dialog .sidebar li.tab-appearance").click()
|
|
await expect(page.locator("css=.settings .tab-content.tab-appearance")).toBeVisible()
|
|
await page.getByLabel("Show line numbers").click()
|
|
await expect(page.locator("css=.cm-lineNumbers")).toBeHidden()
|
|
expect((await heynotePage.getStoredSettings()).showLineNumberGutter).toBe(false)
|
|
await page.getByLabel("Show line numbers").click()
|
|
await expect(page.locator("css=.cm-lineNumbers")).toBeVisible()
|
|
expect((await heynotePage.getStoredSettings()).showLineNumberGutter).toBe(true)
|
|
})
|