mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-06 08:58:05 +00:00
f4e3c267cd
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).
28 lines
672 B
TypeScript
28 lines
672 B
TypeScript
import '@testing-library/jest-dom/vitest';
|
|
import { afterEach, vi } from 'vitest';
|
|
import { cleanup } from '@testing-library/react';
|
|
|
|
class MockResizeObserver {
|
|
observe() {}
|
|
unobserve() {}
|
|
disconnect() {}
|
|
}
|
|
globalThis.ResizeObserver = globalThis.ResizeObserver ?? MockResizeObserver;
|
|
|
|
if (typeof window !== 'undefined' && !window.matchMedia) {
|
|
window.matchMedia = vi.fn().mockImplementation((query: string) => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: vi.fn(),
|
|
removeListener: vi.fn(),
|
|
addEventListener: vi.fn(),
|
|
removeEventListener: vi.fn(),
|
|
dispatchEvent: vi.fn(),
|
|
}));
|
|
}
|
|
|
|
afterEach(() => {
|
|
cleanup();
|
|
});
|