learning_ai_common_plat/dashboards/admin-web/vitest.config.ts
saravanakumardb1 aa0e67d219 feat(admin-web): add @bytelyst/motion reveal/stagger on dashboard (UX-5)
- @bytelyst/motion added workspace:* (importer-only lockfile change;
  --frozen-lockfile clean).
- Dashboard overview only: KPI cards grid wrapped in StaggerList (from up,
  50ms stagger); the Model-Usage / Recent-Users table row wrapped in Reveal.
- Primitives honor prefers-reduced-motion and resolve to opacity 1, so no
  element is stranded transparent (no contrast/a11y regression); prefersReduced
  is SSR-safe. Motion is confined to the auth-gated dashboard, not the public
  e2e surfaces, per tracker-web's axe/opacity caution.
- vitest.config: inline @bytelyst/motion + react dedupe for the render test.

Tests: happy-dom asserts Reveal/StaggerList end visible and render all children.

Verify: typecheck+lint+build green (123 routes); vitest 21 files / 170 tests
(+2); format:check no new failures; e2e 11 passed / 80 failed (unchanged vs
UX-1 baseline — environmental).

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-29 14:19:28 -07:00

49 lines
1.3 KiB
TypeScript

import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
test: {
environment: 'node',
globals: true,
exclude: ['e2e/**', 'node_modules/**'],
// Inline the workspace SVG-chart packages so Vitest transforms them and
// resolves their `react` import through the dedupe below. Without this the
// chart dist (linked from a sibling repo's pnpm store) loads a second
// physical React copy and `renderToStaticMarkup` throws "Invalid hook call".
// The real Next/webpack build already dedupes these to admin-web's React.
server: {
deps: {
inline: [/@bytelyst\/(charts|data-viz|command-palette|dashboard-components|motion)/],
},
},
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/**',
'.next/**',
'coverage/**',
'**/*.test.ts',
'**/*.test.tsx',
'**/*.config.*',
'**/e2e/**',
],
thresholds: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
// Force a single physical React/React-DOM copy for SSR chart render tests.
dedupe: ['react', 'react-dom'],
},
});