Assessor_2.0/tests/postgres/cve-enrichment-schema.test.ts

13 lines
626 B
TypeScript

import { describe, expect, it } from 'vitest';
import { databaseMigrations } from '../../server/postgres/migration-catalog';
describe('CVE enrichment schema', () => {
it('stores one global NVD record per normalized CVE without tenant ownership', () => {
const migration = databaseMigrations.find(item => item.version === '021');
expect(migration?.sql).toContain('CREATE TABLE assessor_cve_enrichments');
expect(migration?.sql).toContain('cve_id text PRIMARY KEY');
expect(migration?.sql).not.toMatch(/project_id|assessment_id|scan_run_id/);
expect(migration?.sql).toContain("source = 'nvd'");
});
});