feat(ui/kapacitor): improve rule reducer test

pull/5856/head
Pavel Zavora 2022-03-15 08:31:01 +01:00
parent b9af9cc995
commit 44c8d56637
1 changed files with 7 additions and 2 deletions

View File

@ -105,7 +105,10 @@ describe('Kapacitor.Reducers.rules', () => {
[ruleID]: {
id: ruleID,
queryID: 988,
alertNodes: {},
alertNodes: {
stateChangesOnly: false,
noRecoveries: true,
},
},
}
const updatedSlack = {
@ -125,7 +128,9 @@ describe('Kapacitor.Reducers.rules', () => {
initialState,
updateAlertNodes(ruleID, [updatedSlack])
)
expect(newState[ruleID].alertNodes.slack[0]).toEqual(expectedSlack)
const expectedState = JSON.parse(JSON.stringify(initialState))
expectedState[ruleID].alertNodes.slack = [expectedSlack]
expect(newState).toEqual(expectedState)
})
it('can update the name', () => {