test(kapacitor): add reducers test
parent
9fb627c3b5
commit
9e1add4cb9
|
@ -12,6 +12,7 @@ import {
|
|||
updateRuleName,
|
||||
deleteRuleSuccess,
|
||||
updateRuleStatusSuccess,
|
||||
updateNoRecoveries,
|
||||
} from 'src/kapacitor/actions/view'
|
||||
|
||||
describe('Kapacitor.Reducers.rules', () => {
|
||||
|
@ -193,4 +194,21 @@ describe('Kapacitor.Reducers.rules', () => {
|
|||
)
|
||||
expect(newState[ruleID].status).toBe(status)
|
||||
})
|
||||
|
||||
it('can set noRecoveries', () => {
|
||||
const ruleID = 1
|
||||
|
||||
const initialState = {
|
||||
[ruleID]: {
|
||||
id: ruleID,
|
||||
queryID: 988,
|
||||
alertNodes: {
|
||||
noRecoveries: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const newState = reducer(initialState, updateNoRecoveries(ruleID, true))
|
||||
expect(newState[ruleID].alertNodes.noRecoveries).toBe(true)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue