182ccf2c72
The previous color values did not actually meet WCAG AAA (7:1) on
all 4 page surfaces — the spec's contrast table was aspirational.
The contrast test correctly caught 19 of 37 failing assertions.
Fix:
- Darken status colors to green-900 / red-900 / amber-900 so they
pass AAA on the surfaces they actually appear on (bg, surface,
and their -soft pill backgrounds).
- Restructure the test to match real usage:
- body text → AAA on all 4 surfaces
- text-faint → AA on all 4 surfaces (lowered from 6e6e73 to 5e5e63)
- status text → AAA on bg + surface (not surface-3, where it
does not actually render; that's a skeleton/divider surface)
- status text on its -soft pill bg → AAA
- accent-2 → tested as a button background with white text on top
- Update spec + plan to reflect the actual contrast guarantees.
Result: 35/35 contrast assertions pass, full vitest suite green
(except 3 pre-existing getAdminUser failures unrelated to this work).
29 lines
1005 B
TypeScript
29 lines
1005 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
import react from "@vitejs/plugin-react";
|
|
import path from "node:path";
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: [
|
|
{ find: /^@\/(?!db)/, replacement: path.resolve(__dirname, "src") + "/" },
|
|
{ find: "@/db/client", replacement: path.resolve(__dirname, "db/client.ts") },
|
|
{ find: "@/db/schema", replacement: path.resolve(__dirname, "db/schema/index.ts") },
|
|
{ find: "@/db", replacement: path.resolve(__dirname, "db") },
|
|
],
|
|
},
|
|
test: {
|
|
environment: "node",
|
|
include: [
|
|
"tests/unit/**/*.test.ts",
|
|
"tests/unit/**/*.test.tsx",
|
|
"src/lib/__tests__/**/*.test.ts",
|
|
"src/lib/__tests__/**/*.test.tsx",
|
|
],
|
|
exclude: ["node_modules", ".next", "tests/e2e/**", "tests/login/**", "tests/smoke.spec.ts"],
|
|
// Supabase REST, Auth.js v5, and Next.js `cookies()` / `headers()` are
|
|
// stubbed in each test — keep the timeout generous.
|
|
testTimeout: 15_000,
|
|
},
|
|
});
|