Skip to content

Commit

Permalink
Add awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
heyman committed Jan 4, 2024
1 parent b6857a2 commit 81899df
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ test.beforeEach(async ({ page }) => {


test("test open settings dialog", async ({ page }) => {
page.locator("css=.status-block.settings").click()
await page.locator("css=.status-block.settings").click()
await expect(page.locator("css=.overlay .settings .dialog")).toBeVisible()
})

test("test close settings dialog", async ({ page }) => {
page.locator("css=.status-block.settings").click()
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 }) => {
page.locator("css=.status-block.settings").click()
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()
page.locator("css=.status-block.settings").click()
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()
page.getByLabel("Show line numbers").click()
await page.getByLabel("Show line numbers").click()
await expect(page.locator("css=.cm-lineNumbers")).toBeHidden()
expect((await heynotePage.getStoredSettings()).showLineNumberGutter).toBe(false)
page.getByLabel("Show line numbers").click()
await page.getByLabel("Show line numbers").click()
await expect(page.locator("css=.cm-lineNumbers")).toBeVisible()
expect((await heynotePage.getStoredSettings()).showLineNumberGutter).toBe(true)
})

0 comments on commit 81899df

Please sign in to comment.