Pure function mapping the 3-value AlertDto.severity enum to the 2-value DataTable rowAccent prop. INFO maps to undefined (no tint) because the DS DataTable rowAccent only supports error|warning. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
17 lines
464 B
TypeScript
17 lines
464 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { severityToAccent } from './severity-utils';
|
|
|
|
describe('severityToAccent', () => {
|
|
it('maps CRITICAL → error', () => {
|
|
expect(severityToAccent('CRITICAL')).toBe('error');
|
|
});
|
|
|
|
it('maps WARNING → warning', () => {
|
|
expect(severityToAccent('WARNING')).toBe('warning');
|
|
});
|
|
|
|
it('maps INFO → undefined (no row tint)', () => {
|
|
expect(severityToAccent('INFO')).toBeUndefined();
|
|
});
|
|
});
|