mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-05-07 01:02:36 +00:00
absolutely massive typescript porting time
This commit is contained in:
parent
01f238f515
commit
30d08a630f
159 changed files with 2563 additions and 3861 deletions
23
packages/roleypoly-ui/components/role/__test__/demo.test.tsx
Normal file
23
packages/roleypoly-ui/components/role/__test__/demo.test.tsx
Normal file
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* @jest-environment jsdom
|
||||
*/
|
||||
/* 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 el = <RoleDemo role={{ name: 'test demo role', color: '#ffffff' }} />
|
||||
const demo = shallow<typeof el>(el)
|
||||
expect(demo.state().active).toEqual(false)
|
||||
demo.dive().simulate('click')
|
||||
expect(demo.state().active).toEqual(true)
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue