Add initial passing enzyme test for KapacitorRules render

pull/10616/head
Jared Scheib 2018-03-14 16:06:34 -07:00
parent c6da352204
commit afa0acb63e
1 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,39 @@
import React from 'react'
import {shallow} from 'enzyme'
import KapacitorRules from 'src/kapacitor/components/KapacitorRules'
import {source, kapacitorRules} from 'test/resources'
jest.mock('src/shared/apis', () => require('mocks/shared/apis'))
const setup = (override = {}) => {
const props = {
source,
rules: kapacitorRules,
hasKapacitor: true,
loading: false,
onDelete: () => {},
onChangeRuleStatus: () => {},
}
const wrapper = shallow(<KapacitorRules {...props} />)
return {
wrapper,
props,
}
}
describe('Kapacitor.Containers.KapacitorRules', () => {
afterEach(() => {
jest.clearAllMocks()
})
describe('rendering', () => {
it('renders the KapacitorRules', () => {
const {wrapper} = setup()
expect(wrapper.exists()).toBe(true)
})
})
})