feat(alerts/ui): add severityToAccent helper for DataTable rowAccent
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>
This commit is contained in:
16
ui/src/pages/Alerts/severity-utils.test.ts
Normal file
16
ui/src/pages/Alerts/severity-utils.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user