Skip to content

Commit

Permalink
feat(ui/kapacitor): improve rule reducer test
Browse files Browse the repository at this point in the history
  • Loading branch information
sranka committed Mar 15, 2022
1 parent b9af9cc commit 44c8d56
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ui/test/kapacitor/reducers/rules.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ describe('Kapacitor.Reducers.rules', () => {
[ruleID]: {
id: ruleID,
queryID: 988,
alertNodes: {},
alertNodes: {
stateChangesOnly: false,
noRecoveries: true,
},
},
}
const updatedSlack = {
Expand All @@ -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', () => {
Expand Down

0 comments on commit 44c8d56

Please sign in to comment.