@@ -84,41 +84,39 @@ describe('Usage', () => {
8484 } ) . catch ( done . fail )
8585 } )
8686
87- // it('stateless component with props', done => {
88- // compileWithDeps('recycle-list/components/stateless-with-props.vue', [{
89- // name: 'poster',
90- // path: 'recycle-list/components/poster.vue'
91- // }]).then(code => {
92- // const id = String(Date.now() * Math.random())
93- // const instance = createInstance(id, code)
94- // setTimeout(() => {
95- // const target = readObject('recycle-list/components/stateless-with-props.vdom.js')
96- // expect(getRoot(instance)).toEqual(target)
97- // done()
98- // }, 50)
99- // }).catch(done.fail)
100- // })
87+ it ( 'stateless component with props' , done => {
88+ compileWithDeps ( 'recycle-list/components/stateless-with-props.vue' , [ {
89+ name : 'poster' ,
90+ path : 'recycle-list/components/poster.vue'
91+ } ] ) . then ( code => {
92+ const id = String ( Date . now ( ) * Math . random ( ) )
93+ const instance = createInstance ( id , code )
94+ setTimeout ( ( ) => {
95+ const target = readObject ( 'recycle-list/components/stateless-with-props.vdom.js' )
96+ expect ( getRoot ( instance ) ) . toEqual ( target )
97+ done ( )
98+ } , 50 )
99+ } ) . catch ( done . fail )
100+ } )
101101
102- // it('stateful component', done => {
103- // compileWithDeps('recycle-list/components/stateful.vue', [{
104- // name: 'counter',
105- // path: 'recycle-list/components/counter.vue'
106- // }]).then(code => {
107- // const id = String(Date.now() * Math.random())
108- // const instance = createInstance(id, code)
109- // setTimeout(() => {
110- // const target = readObject('recycle-list/components/stateful.vdom.js')
111- // expect(getRoot(instance)).toEqual(target)
112- // const event = getEvents(instance)[0]
113- // fireEvent(instance, event.ref, event.type, {})
114- // setTimeout(() => {
115- // // TODO: check render results
116- // // expect(getRoot(instance)).toEqual(target)
117- // done()
118- // })
119- // }, 50)
120- // }).catch(done.fail)
121- // })
102+ it ( 'stateful component' , done => {
103+ compileWithDeps ( 'recycle-list/components/stateful.vue' , [ {
104+ name : 'counter' ,
105+ path : 'recycle-list/components/counter.vue'
106+ } ] ) . then ( code => {
107+ const id = String ( Date . now ( ) * Math . random ( ) )
108+ const instance = createInstance ( id , code )
109+ setTimeout ( ( ) => {
110+ const target = readObject ( 'recycle-list/components/stateful.vdom.js' )
111+ expect ( getRoot ( instance ) ) . toEqual ( target )
112+ const event = getEvents ( instance ) [ 0 ]
113+ fireEvent ( instance , event . ref , event . type , { } )
114+ setTimeout ( ( ) => {
115+ expect ( getRoot ( instance ) ) . toEqual ( target )
116+ done ( )
117+ } )
118+ } , 50 )
119+ } ) . catch ( done . fail )
120+ } )
122121 } )
123122} )
124-
0 commit comments