mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-14 13:36:36 +00:00
test: update routes in tests
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
import { expect, test } from "playwright/test";
|
||||
import { trackErrors, expectNoErrors } from "./helpers/page";
|
||||
import { expectNoErrors, trackErrors } from "./helpers/page";
|
||||
|
||||
const TOTAL = 121;
|
||||
const GROUPS = 8;
|
||||
|
||||
test("catalog shows total and all groups", async ({ page }) => {
|
||||
const sink = trackErrors(page);
|
||||
await page.goto("/preview/list-tools");
|
||||
await page.goto("/list-tools");
|
||||
await expect(page.locator(".catalog-total b")).toHaveText(String(TOTAL));
|
||||
await expect(page.locator(".catalog-group")).toHaveCount(GROUPS);
|
||||
expectNoErrors(sink);
|
||||
});
|
||||
|
||||
test("catalog search narrows results", async ({ page }) => {
|
||||
await page.goto("/preview/list-tools");
|
||||
await page.goto("/list-tools");
|
||||
await expect(async () => {
|
||||
await page.getByRole("textbox", { name: "Search tools" }).fill("resize");
|
||||
await expect(page.locator(".tool-card")).toHaveCount(1);
|
||||
@@ -24,7 +24,7 @@ test("catalog search narrows results", async ({ page }) => {
|
||||
test("category filter shows only matching group and resets on ALL", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/preview/list-tools");
|
||||
await page.goto("/list-tools");
|
||||
const allButtons = page.locator(".tool-card");
|
||||
const allCount = await allButtons.count();
|
||||
expect(allCount).toBe(TOTAL);
|
||||
@@ -46,7 +46,7 @@ test("category filter shows only matching group and resets on ALL", async ({
|
||||
});
|
||||
|
||||
test("workspace search matches a tool by title", async ({ page }) => {
|
||||
await page.goto("/preview");
|
||||
await page.goto("/");
|
||||
await expect(async () => {
|
||||
await page.getByRole("textbox", { name: "Search tools" }).fill("flip");
|
||||
await expect(page.locator(".tool-card")).toHaveCount(1);
|
||||
|
||||
Reference in New Issue
Block a user