shieldx/tests/unit/compliance/NIS2Mapper.test.ts
Claude 1b5f698f4c
Some checks failed
security-scan / secret-scan (push) Failing after 3s
feat(compliance): add NIS2/ISO27001/SOC2 mappers, Compliance-Robot, EU-AI-Act-Agent; docs(flexoptix-os): consolidation concept
Extends the existing ATLAS/OWASP/EU-AI-Act compliance module with three
new control-framework mappers (NIS2 Art. 21(2), ISO/IEC 27001 Annex A,
SOC 2 Trust Services Criteria), each honestly marking what ShieldX
covers vs. what remains an organizational/legal gap.

ComplianceRobot aggregates all four frameworks into a single prioritized,
owned action plan. EUAIActAgent adds active workflows on top of the
existing static reporter: Art. 6/Annex III risk pre-screening, Annex IV
technical documentation scaffolding, Art. 72 post-market monitoring plan,
and the corrected 2027/2028 enforcement timeline.

Adds docs/flexoptix-os/ — a broader consolidation concept covering the
current state (Magatama/ShieldX, EO Global Pulse), target architecture
for BEO (LibreChat/Presidio-based), a Transceiver Intelligence Platform
architecture recommendation, and RunWork OS externalization strategy,
grounded in adversarially-verified research citations.
2026-07-14 14:46:51 +00:00

51 lines
1.5 KiB
TypeScript

import { describe, it, expect, beforeEach } from 'vitest'
import { NIS2Mapper } from '../../../src/compliance/NIS2Mapper.js'
describe('NIS2Mapper', () => {
let mapper: NIS2Mapper
beforeEach(() => {
mapper = new NIS2Mapper()
})
describe('getMeasure()', () => {
it('should return the incident handling measure', () => {
const measure = mapper.getMeasure('NIS2.Art21.2.b')
expect(measure).toBeDefined()
expect(measure!.implemented).toBe(true)
expect(measure!.shieldxEvidence).toContain('HealingOrchestrator')
})
it('should return a gap for MFA/secured communications', () => {
const measure = mapper.getMeasure('NIS2.Art21.2.j')
expect(measure).toBeDefined()
expect(measure!.implemented).toBe(false)
expect(measure!.gapNote).toBeTruthy()
})
it('should return undefined for unknown measure', () => {
expect(mapper.getMeasure('NIS2.Art21.2.z')).toBeUndefined()
})
})
describe('getCoverage()', () => {
it('should report 10 total measures', () => {
const coverage = mapper.getCoverage()
expect(coverage.total).toBe(10)
expect(coverage.covered).toBeGreaterThan(0)
expect(coverage.covered).toBeLessThan(coverage.total)
})
it('should list uncovered measure IDs as gaps', () => {
const coverage = mapper.getCoverage()
expect(coverage.gaps).toContain('NIS2.Art21.2.j')
})
})
describe('getAllMappings()', () => {
it('should return all 10 measures', () => {
expect(mapper.getAllMappings().length).toBe(10)
})
})
})