polish alert operations workspace
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { alertValue, canAct, ruleCondition, thresholdText } from './alert';
|
||||
import { alertValue, canAct, formatAlertTime, ruleCondition, thresholdText } from './alert';
|
||||
|
||||
describe('alert domain helpers', () => {
|
||||
it('keeps trigger evidence and duration explicit', () => {
|
||||
@@ -23,4 +23,8 @@ describe('alert domain helpers', () => {
|
||||
expect(thresholdText({ threshold: 20, thresholdHigh: 80, operator: 'between', unit: '%', durationSec: 30 })).toBe('区间内 20–80 %,持续 30 秒');
|
||||
expect(ruleCondition({ valueType: 'boolean', metric: 'alarm_active', operator: 'changed', durationSec: 0 } as never)).toBe('协议告警位 状态变化');
|
||||
});
|
||||
|
||||
it('renders operational timestamps in the shared Shanghai timezone', () => {
|
||||
expect(formatAlertTime('2026-07-18T02:33:00Z')).toBe('07-18 10:33:00');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user