Files
projectbrain-Public/e2e/project-list-view.spec.ts
T

15 lines
1.0 KiB
TypeScript

import { expect, test } from "@playwright/test";
test("project search and sort survive reload and clearing preserves sorting", async ({ page }) => {
await page.goto("/projects?q=widefrog&sort=name");
await expect(page.getByRole("textbox", { name: "Projecten zoeken", exact: true })).toHaveValue("widefrog");
await expect(page.getByRole("button", { name: "Naam", exact: true })).toHaveAttribute("aria-pressed", "true");
await page.getByRole("textbox", { name: "Projecten zoeken", exact: true }).fill("no-project-matches-this");
await page.reload();
await expect(page.getByRole("textbox", { name: "Projecten zoeken", exact: true })).toHaveValue("no-project-matches-this");
await page.getByRole("button", { name: "Selectie wissen", exact: true }).click();
await expect(page.getByRole("textbox", { name: "Projecten zoeken", exact: true })).toHaveValue("");
await expect(page.getByRole("button", { name: "Naam", exact: true })).toHaveAttribute("aria-pressed", "true");
await expect(page).toHaveURL(/sort=name/);
});