phase 16 implementation
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { containsSensitiveKey, redactSensitive } from '@/lib/demo/redaction';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('privacy-safe diagnostics', () => {
|
||||
it('redacts nested personal fields', () => {
|
||||
expect(
|
||||
redactSensitive({
|
||||
category: 'validation',
|
||||
lead: { workEmail: 'person@example.test', company: 'Example Rentals' },
|
||||
}),
|
||||
).toEqual({
|
||||
category: 'validation',
|
||||
lead: { workEmail: '[REDACTED]', company: '[REDACTED]' },
|
||||
});
|
||||
});
|
||||
|
||||
it('detects sensitive diagnostic structures', () => {
|
||||
expect(containsSensitiveKey({ context: { message: 'private' } })).toBe(true);
|
||||
expect(containsSensitiveKey({ category: 'timeout', correlationId: 'abc' })).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user