diff --git a/public/app/features/expressions/components/__snapshots__/hysteresis.test.ts.snap b/public/app/features/expressions/components/__snapshots__/hysteresis.test.ts.snap index 452fcd7305a..6af902b384d 100644 --- a/public/app/features/expressions/components/__snapshots__/hysteresis.test.ts.snap +++ b/public/app/features/expressions/components/__snapshots__/hysteresis.test.ts.snap @@ -72,7 +72,6 @@ exports[`thresholdReducer should update Threshold Type, and unloadEvaluator para { "evaluator": { "params": [ - 10, 0, ], "type": "lt", @@ -90,7 +89,6 @@ exports[`thresholdReducer should update Threshold Type, and unloadEvaluator para "type": "query", "unloadEvaluator": { "params": [ - 10, 0, ], "type": "gt", diff --git a/public/app/features/expressions/components/hysteresis.test.ts b/public/app/features/expressions/components/hysteresis.test.ts index 7f802aa13f7..13a87d022e3 100644 --- a/public/app/features/expressions/components/hysteresis.test.ts +++ b/public/app/features/expressions/components/hysteresis.test.ts @@ -159,7 +159,7 @@ describe('thresholdReducer', () => { expect(newState.conditions[0].evaluator.type).toEqual(EvalFunction.IsBelow); expect(newState.conditions[0].unloadEvaluator?.type).toEqual(EvalFunction.IsAbove); expect(onError).toHaveBeenCalledWith(undefined); - expect(newState.conditions[0].unloadEvaluator?.params[0]).toEqual(10); + expect(newState.conditions[0].unloadEvaluator?.params[0]).toEqual(0); }); it('Should update unlooadEvaluator when checking hysteresis', () => { const initialState: ThresholdExpressionQuery = { diff --git a/public/app/features/expressions/components/thresholdReducer.ts b/public/app/features/expressions/components/thresholdReducer.ts index 503baa3e727..17ccf5d233b 100644 --- a/public/app/features/expressions/components/thresholdReducer.ts +++ b/public/app/features/expressions/components/thresholdReducer.ts @@ -33,6 +33,9 @@ export const thresholdReducer = createReducer( //set new type in evaluator state.conditions[0].evaluator.type = typeInPayload; + //reset params + state.conditions[0].evaluator.params = [0]; + // check if hysteresis is checked const hsyteresisIsChecked = Boolean(state.conditions[0].unloadEvaluator);