rallly/tests/i18n.spec.ts
2022-07-21 17:11:10 +01:00

15 lines
586 B
TypeScript

import test, { expect } from "@playwright/test";
test("should show correct language if supported", async ({ browser }) => {
const context = await browser.newContext({ locale: "de" });
const page = await context.newPage();
await page.goto("/");
await expect(page.locator("text=Los geht's")).toBeVisible();
});
test("should default to english", async ({ browser }) => {
const context = await browser.newContext({ locale: "mt" });
const page = await context.newPage();
await page.goto("/new");
await expect(page.locator("h1", { hasText: "New poll" })).toBeVisible();
});