feat: add testing framework and initial test cases

- Updated package.json to include Vitest and testing dependencies.
- Created test cases for SuitePicker component to validate selection logic.
- Added tests for ReportsPage to ensure correct report grouping and ordering.
- Implemented read-only enforcement tests for SuitePage to prevent actions on built-in suites.
- Introduced a setup file for Vitest to include jest-dom matchers and cleanup after tests.
- Modified ReportsPage to group reports by model and display them accordingly.
- Enhanced API types to include suite_scope and question_count for better report handling.
This commit is contained in:
Netherwarlord
2026-07-28 20:06:26 -04:00
parent 8f246fabbc
commit 7a81468925
26 changed files with 2487 additions and 168 deletions
+10 -1
View File
@@ -1,4 +1,6 @@
import { defineConfig } from 'vite'
// defineConfig comes from vitest/config rather than vite so the `test` block
// below type-checks; it is vite's own, widened with Vitest's options.
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
@@ -28,4 +30,11 @@ export default defineConfig({
emptyOutDir: true,
chunkSizeWarningLimit: 900,
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./src/test/setup.ts'],
// Only our own tests; node_modules and the built bundle are not ours.
include: ['src/**/*.test.{ts,tsx}'],
},
})