-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
1 changed file
with
46 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,46 @@ | ||
import { test, expect } from "@playwright/test" | ||
import { describe } from "node:test" | ||
|
||
describe("init corpus selection", () => { | ||
test("none selected", async ({ page }) => { | ||
await page.goto("/#?lang=eng&corpus=") | ||
await expect(page.locator("corpus-chooser")).toContainText("23 of") | ||
}) | ||
|
||
test("few selected", async ({ page }) => { | ||
await page.goto("/#?lang=eng&corpus=attasidor,da") | ||
await expect(page.locator("corpus-chooser")).toContainText("2 of") | ||
}) | ||
|
||
test("some nonexisting", async ({ page }) => { | ||
await page.goto("/#?lang=eng&corpus=attasidor,da,abc") | ||
await expect(page.getByRole("dialog")).toContainText("Some selected corpora are not available") | ||
await page.getByRole("button").click() | ||
await expect(page.locator("corpus-chooser")).toContainText("2 of") | ||
}) | ||
|
||
test("all nonexisting", async ({ page }) => { | ||
await page.goto("/#?lang=eng&corpus=abc,def") | ||
await expect(page.getByRole("dialog")).toContainText("Some selected corpora are not available") | ||
await page.getByRole("button").click() | ||
await expect(page.locator("corpus-chooser")).toContainText("23 of") | ||
}) | ||
|
||
test("some protected", async ({ page }) => { | ||
await page.goto("/#?lang=eng&corpus=attasidor,da,asu") | ||
await expect(page.getByRole("dialog")).toContainText("Login needed") | ||
await page.getByRole("button").click() | ||
// Dismiss login prompt | ||
await page.locator(".close-x").click() | ||
await expect(page.locator("corpus-chooser")).toContainText("2 of") | ||
}) | ||
|
||
test("all protected", async ({ page }) => { | ||
await page.goto("/#?lang=eng&corpus=asu") | ||
await expect(page.getByRole("dialog")).toContainText("Login needed") | ||
await page.getByRole("button").click() | ||
// Dismiss login prompt | ||
await page.locator(".close-x").click() | ||
await expect(page.locator("corpus-chooser")).toContainText("23 of") | ||
}) | ||
}) |