Assessor_2.0/tests/features/group-policy-presentation.t...

17 lines
818 B
TypeScript

import { describe, expect, it } from 'vitest';
import { formatPolicyComparisonValue, policyValueName } from '../../src/profiles/group-policy/presentation';
describe('GPO comparison value presentation', () => {
it('unwraps normalized scalar values and preserves structured facts as readable lines', () => {
expect(formatPolicyComparisonValue('{"kind":"number","value":14}')).toBe('14');
expect(formatPolicyComparisonValue('[{"kind":"registry-policy","valueName":"Mode","data":{"kind":"uint32","value":1}}]'))
.toBe('Data: 1');
expect(policyValueName('[{"kind":"registry-policy","valueName":"Mode","data":{"kind":"uint32","value":1}}]'))
.toBe('Mode');
});
it('keeps non-JSON source values unchanged', () => {
expect(formatPolicyComparisonValue('Enabled')).toBe('Enabled');
});
});