test: update routes in tests

This commit is contained in:
2026-09-10 20:40:49 +05:00
parent 33e3f3c4f0
commit 0160b316c9
8 changed files with 64 additions and 41 deletions
+5 -5
View File
@@ -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);