diff --git a/ui/src/pages/Alerts/RuleEditor/form-state.test.ts b/ui/src/pages/Alerts/RuleEditor/form-state.test.ts index 1563b1f1..c2d0b3fc 100644 --- a/ui/src/pages/Alerts/RuleEditor/form-state.test.ts +++ b/ui/src/pages/Alerts/RuleEditor/form-state.test.ts @@ -1,5 +1,9 @@ import { describe, it, expect } from 'vitest'; -import { initialForm, toRequest, validateStep } from './form-state'; +// `applyFireModeChange` will be introduced by Task 4.3 as a pure helper in +// `form-state.ts` so that the ExchangeMatchForm can reuse it on mode-toggle +// and guarantee state hygiene (no stale COUNT_IN_WINDOW fields leaking into a +// PER_EXCHANGE rule payload and vice-versa). These tests pin the contract. +import { applyFireModeChange, initialForm, toRequest, validateStep } from './form-state'; describe('initialForm', () => { it('defaults to env-wide ROUTE_METRIC with safe intervals', () => { @@ -80,3 +84,79 @@ describe('validateStep', () => { expect(validateStep('condition', f)).toEqual([]); }); }); + +// ---------------------------------------------------------------------------- +// Task 4.2 RED: fire-mode toggle state hygiene +// +// `applyFireModeChange(form, newMode)` is the pure helper (Task 4.3) that the +// ExchangeMatchForm's Fire-mode