test(security): add scan comparison coverage (#656)

Backend supertest suite for GET /api/security/compare covers tier gating,
input validation, cross-node isolation, diff partitioning by
vulnerability_id::pkg_name, suppression application, and cross-image
comparison. Frontend vitest + React Testing Library scaffolding with
component tests for ScanComparisonSheet (loading, error recovery,
cross-image warning, filter pills, reload on id change) and
SecurityHistoryView (mount fetch, selection cap, oldest-first baseline
ordering, tier gating).
This commit is contained in:
Anso
2026-04-17 13:44:40 -04:00
committed by GitHub
parent fe8abaac55
commit f4e3c267cd
7 changed files with 1833 additions and 3 deletions
+10 -2
View File
@@ -8,7 +8,9 @@
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
"preview": "vite preview",
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"@dagrejs/dagre": "^3.0.0",
@@ -60,6 +62,10 @@
"devDependencies": {
"@eslint/js": "^10.0.1",
"@tailwindcss/vite": "^4.2.2",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^25.5.2",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
@@ -68,9 +74,11 @@
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.4.0",
"jsdom": "^29.0.2",
"tailwindcss": "^4.2.2",
"typescript": "^6.0.2",
"typescript-eslint": "^8.58.1",
"vite": "^8.0.8"
"vite": "^8.0.8",
"vitest": "^4.1.4"
}
}