Files
carmanagement/apps/homepage/tests/unit/integrations/redaction.test.ts
T
root d7fb7b7a7b
Build & Deploy / Build & Push Docker Image (push) Failing after 47s
Build & Deploy / Deploy to VPS (push) Has been skipped
Test / API Unit Tests (push) Failing after 5m4s
Test / Marketplace Unit Tests (push) Failing after 4m55s
Test / Admin Unit Tests (push) Successful in 9m37s
Test / Dashboard Unit Tests (push) Successful in 9m37s
Test / API Integration Tests (push) Successful in 9m54s
redesign the homepage
2026-06-26 16:27:21 -04:00

22 lines
742 B
TypeScript

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);
});
});