25 lines
1.2 KiB
TypeScript
25 lines
1.2 KiB
TypeScript
import { test, expect } from "./_test";
|
|
|
|
test("filter", async ({ login: page }) => {
|
|
await page.goto("/plan");
|
|
await expect(page).toHaveTitle("Planung");
|
|
|
|
const filterbar = page.locator(".filterbar-outer");
|
|
const filterIn = filterbar.getByPlaceholder("Filter");
|
|
await filterIn.click();
|
|
await filterbar.getByRole("option", { name: "Kategorie" }).click();
|
|
await filterbar.getByRole("option", { name: "Laborabnahme" }).click();
|
|
await filterIn.click();
|
|
await filterbar.getByRole("option", { name: "Zimmer" }).click();
|
|
await filterbar.getByRole("option", { name: "R1.5" }).click();
|
|
await filterIn.click();
|
|
await filterbar.getByRole("option", { name: "Autor" }).click();
|
|
await filterbar.getByRole("option", { name: "Akeem Wisozk" }).click();
|
|
|
|
await expect(page).toHaveURL("http://localhost:4173/plan?filter%5Bcategory%5D%5B0%5D%5Bid%5D=1&filter%5Bcategory%5D%5B0%5D%5Bname%5D=Laborabnahme&filter%5Broom%5D%5B0%5D%5Bid%5D=5&filter%5Broom%5D%5B0%5D%5Bname%5D=R1.5&filter%5Bauthor%5D%5B0%5D%5Bid%5D=5&filter%5Bauthor%5D%5B0%5D%5Bname%5D=Akeem%20Wisozk");
|
|
|
|
const table = page.getByTestId("entry-table");
|
|
const firstRow = table.locator("tbody > tr").first();
|
|
|
|
await expect(firstRow.locator("td > a").first()).toHaveText("275");
|
|
});
|