-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update fuse.js * chore: update jsdom * chore: update node-fetch-cache * chore: update rehype-mdx-code-props
- Loading branch information
1 parent
868d37b
commit ad93345
Showing
6 changed files
with
126 additions
and
125 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
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 } from "@playwright/test"; | ||
|
||
test.describe("Header", () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto("/wiki/"); | ||
}); | ||
|
||
test("Exists", async ({ page }) => { | ||
await expect(page.getByRole("banner")).toBeVisible(); | ||
}); | ||
|
||
test("Home Link", async ({ page, baseURL }) => { | ||
await page.getByRole("link", { name: "house" }).click(); | ||
expect(page.url()).toBe(baseURL); | ||
}); | ||
|
||
test("Wiki Link", async ({ page, baseURL }) => { | ||
await page.getByRole("link", { name: "book" }).click(); | ||
await page.waitForURL("/wiki/"); | ||
expect(page.url()).toBe(baseURL + "wiki/"); | ||
}); | ||
|
||
test("GitHub Link", async ({ page, context }) => { | ||
const href = await page | ||
.getByRole("link", { name: "github" }) | ||
.getAttribute("href"); | ||
expect(href).toBe("https://github.com/luals/lua-language-server"); | ||
}); | ||
}); |
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
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,67 @@ | ||
import { test, expect, type Locator } from "@playwright/test"; | ||
|
||
test.describe("Search", async () => { | ||
let searchInput: Locator; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto("/wiki/"); | ||
|
||
searchInput = page.getByPlaceholder("Search..."); | ||
}); | ||
|
||
const isOpen = async () => { | ||
await expect(searchInput).toBeVisible(); | ||
await expect(searchInput).toBeFocused(); | ||
}; | ||
|
||
const isClosed = async () => { | ||
await expect(searchInput).not.toBeVisible(); | ||
}; | ||
|
||
test("Open Search With Button", async ({ page }) => { | ||
await page.getByRole("button", { name: "search" }).click(); | ||
await isOpen(); | ||
}); | ||
|
||
test("Open Search With Keypress", async ({ page }) => { | ||
await page.getByRole("document").press("/"); | ||
await isOpen(); | ||
}); | ||
|
||
test("Close Search With Escape", async ({ page }) => { | ||
await page.getByRole("document").press("/"); | ||
await isOpen(); | ||
await searchInput.press("Escape"); | ||
await isClosed(); | ||
}); | ||
|
||
test("Close Search By Clicking Background", async ({ page }) => { | ||
await page.getByRole("document").press("/"); | ||
await isOpen(); | ||
await page.locator("#site-search").click(); | ||
await isClosed(); | ||
}); | ||
|
||
test("Search Finds Privacy Page", async ({ page, baseURL }) => { | ||
await page.getByRole("document").press("/"); | ||
await searchInput.fill("priva"); | ||
const link = page.getByRole("link", { name: "Privacy /privacy" }); | ||
|
||
await expect(link).toBeVisible(); | ||
await searchInput.press("Enter"); | ||
expect(page.url()).toBe(`${baseURL}privacy/`); | ||
}); | ||
|
||
test("Search Finds GitHub Repository", async ({ page, context }) => { | ||
await page.getByRole("document").press("/"); | ||
await searchInput.fill("reposit"); | ||
const link = page.getByRole("link", { | ||
name: "GitHub Repository https://github.com/LuaLS/LuaLS.github.io", | ||
}); | ||
|
||
await expect(link).toBeVisible(); | ||
|
||
const href = await link.getAttribute("href"); | ||
expect(href).toBe("https://github.com/LuaLS/LuaLS.github.io"); | ||
}); | ||
}); |
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
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