11import { mount } from 'enzyme'
22import React from 'react'
33
4- import { sleep } from './util'
5-
64import Input from '../src'
75
86describe ( 'src/index' , ( ) => {
@@ -24,30 +22,14 @@ describe('src/index', () => {
2422 } )
2523 } )
2624
27- describe ( 'simulate events' , async ( ) => {
25+ describe . only ( 'simulate events' , async ( ) => {
2826 let wrapper
2927 it ( 'onchange event' , async ( ) => {
3028 wrapper = mount ( < RenderInput /> )
3129 const input = wrapper . find ( '.or-input input' )
32- input . instance ( ) . value = 'yuki'
33- input . simulate ( 'change' )
34- // input.simulate('focus');
35- // input.simulate('change', { target: { value: 'Changed' } });
36- // input.simulate('keyDown', {
37- // which: 72,
38- // target: {
39- // blur() {
40- // // Needed since <EditableText /> calls target.blur()
41- // input.simulate('blur');
42- // },
43- // },
44- // })
45- // await sleep(500)
46- // expect(input.props().value).toBe('Hello');
47- // input.simulate('change', { target: { value: 'yuki' } })
48- // expect(wrapper.find('input').prop('value')).toBe('yuki')
30+ input . simulate ( 'change' , { target : { value : 'Changed' } } )
4931
50- expect ( input . value ) . toBe ( 'yuki ' )
32+ expect ( input . instance ( ) . value ) . toBe ( 'Changed ' )
5133 } )
5234 } )
5335} )
0 commit comments