mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-19 13:23:50 +03:00
* test(dashboard): reactivate request logger coverage * test(dashboard): assert the request-logger modal by its own label The drift this PR unblocks is real — the next-intl mock lost its `useLocale` export in #7935, so the suite died on `No "useLocale" export is defined`. Restoring it is the actual fix. The dialog assertions were also loosened to `[role="dialog"]`, and that part was not needed: 20 components under src/ render that role, so the selector stops proving this particular modal is the one on screen. Measured — keeping only the `useLocale` fix and restoring a precise selector still passes 6/6. Now asserting `[aria-label="ariaLabel"]`, which is what RequestLoggerDetail.tsx:469 renders (the mock returns the key rather than the translation). --------- Co-authored-by: Paco Cartones <pacocartones@users.noreply.github.com> Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
65 lines
2.9 KiB
TypeScript
65 lines
2.9 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
import react from "@vitejs/plugin-react";
|
|
import path from "path";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
environment: "jsdom",
|
|
globals: true,
|
|
setupFiles: ["./tests/_setup/vitestUiPolyfills.ts"],
|
|
pool: "threads",
|
|
maxWorkers: 20,
|
|
fileParallelism: true,
|
|
maxConcurrency: 20,
|
|
include: [
|
|
"src/app/**/dashboard/cache/__tests__/**/*.test.tsx",
|
|
"src/app/**/dashboard/endpoint/__tests__/**/*.test.tsx",
|
|
"src/app/**/dashboard/providers/**/__tests__/**/*.test.tsx",
|
|
"src/app/**/dashboard/webhooks/__tests__/**/*.test.tsx",
|
|
"src/app/**/dashboard/discovery/__tests__/**/*.test.tsx",
|
|
"src/shared/hooks/__tests__/**/*.test.tsx",
|
|
"src/lib/memory/__tests__/**/*.test.ts",
|
|
"src/lib/skills/__tests__/**/*.test.ts",
|
|
"tests/unit/encryption.test.ts",
|
|
"tests/unit/**/*.test.tsx",
|
|
"open-sse/**/__tests__/**/*.test.ts",
|
|
"open-sse/services/**/__tests__/**/*.test.ts",
|
|
],
|
|
exclude: [
|
|
// Standard Vitest / tooling exclusions
|
|
"node_modules/**",
|
|
"dist/**",
|
|
"cypress/**",
|
|
".idea/**",
|
|
".git/**",
|
|
".cache/**",
|
|
// Live-server E2E — these drive a real running server, so they must never run
|
|
// in this jsdom job. They have their own runners + vitest.e2e-live.config.ts.
|
|
"tests/e2e/ecosystem.test.ts",
|
|
"tests/e2e/protocol-clients.test.ts",
|
|
// ── Pre-existing failures tracked by #8618 ───────────────────────────────
|
|
"tests/unit/ui/logs-page-detail-modal-reopen-on-close.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado
|
|
"tests/unit/ui/agent-card.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado
|
|
"src/app/(dashboard)/dashboard/cache/__tests__/CacheTrends.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado
|
|
"src/app/(dashboard)/dashboard/cache/__tests__/IdempotencyLayer.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado
|
|
"src/app/(dashboard)/dashboard/cache/__tests__/CachePerformance.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado
|
|
"tests/unit/ui/combos-page-smoke.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado
|
|
"tests/unit/ui/evals-tab-smoke.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado
|
|
],
|
|
|
|
coverage: {
|
|
reportsDirectory: "coverage",
|
|
},
|
|
},
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
// Mirrors tsconfig paths. Without it, a UI test importing from open-sse
|
|
// resolves to undefined instead of failing loudly — which silently made
|
|
// every provider look credentialed in the free-tier card tests.
|
|
"@omniroute/open-sse": path.resolve(__dirname, "./open-sse"),
|
|
},
|
|
},
|
|
});
|