add more tests!

This commit is contained in:
41666 2019-03-30 09:17:11 -05:00
parent 77bf715b7b
commit f7e2898633
No known key found for this signature in database
GPG key ID: BC51D07640DC10AF
11 changed files with 241 additions and 38 deletions

View file

@ -0,0 +1,19 @@
/* eslint-env jest */
import * as React from 'react'
import { shallow } from 'enzyme'
import RoleDemo from '../demo'
import 'jest-styled-components'
describe('<RoleDemo />', () => {
it('renders', () => {
const demo = shallow(<RoleDemo role={{ name: 'test demo role', color: '#ffffff' }} />)
expect(demo).toMatchSnapshot()
})
it('changes state when clicked', () => {
const demo = shallow(<RoleDemo role={{ name: 'test demo role', color: '#ffffff' }} />)
expect(demo.state().active).toEqual(false)
demo.dive().simulate('click')
expect(demo.state().active).toEqual(true)
})
})