diff --git a/.gitignore b/.gitignore index de186b0..502df45 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dist/ *.log .DS_Store .vite/ -test-results/ -playwright-report/ +**/test/results/ +**/test/report/ blob-report/ +*.tsbuildinfo diff --git a/AGENTS.md b/AGENTS.md index 8465d4d..791c662 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,17 +4,18 @@ - `app` (React+Vite, 5173), `admin` (React+Vite, 5174), `api` (Express+Prisma+PostgreSQL, 9002). ## Testy — obowiązkowe po każdej zmianie +- Konwencja: WSZYSTKIE testy projektu żyją w `/test/` — unit/komponent w `test/*` (api: `test/unit/` + `test/integration/`), e2e w `test/e2e/`. Rezultaty i artefakty też pod `test/`: `test/results/` (trace/screenshoty Playwright) i `test/report/` (raport HTML) — oba gitignore'owane. Nie twórz katalogów testowych poza `test/`. - `app`/`admin`: `npm test` (vitest), `npm run test:e2e` (Playwright, API mockowane, dev server sam). `api`: `npm test` (unit+integration, supertest). - Testy aktualizujesz w tej samej zmiance co kod. Zmiana UI → najpierw grep starych tekstów/selectorów w testach. - e2e: `import { test } from './fixtures'` (NIE `@playwright/test`) — guard FAIL przy `console.error`/`pageerror`; wyjątek: `allowConsoleError(page, /re/)` + komentarz. Ignorowane: 401. 403/404/5xx = FAIL. -- e2e bez API/DB: `mockApi(page, ...)` z `e2e/mock-api.ts`. Nowe pliki: `e2e/.spec.ts`, opisy PL. +- e2e bez API/DB: `mockApi(page, ...)` z `test/e2e/mock-api.ts`. Nowe pliki: `test/e2e/.spec.ts`, opisy PL. - Selektory: `getByRole`/`getByText`/`input[type=...]` — `getByLabel` NIE działa (`Field` bez `