File tree 4 files changed +52
-36
lines changed
4 files changed +52
-36
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ function update () {
12
12
if ( this . $_mountingOptionsSlots ) {
13
13
addSlots ( this , this . $_mountingOptionsSlots )
14
14
}
15
- const vnodes = this . _render ( )
16
- this . _update ( vnodes )
17
- this . $children . forEach ( child => update . call ( child ) )
18
15
this . _watchers . forEach ( watcher => {
19
16
watcher . run ( )
20
17
} )
18
+ const vnodes = this . _render ( )
19
+ this . _update ( vnodes )
20
+ this . $children . forEach ( child => update . call ( child ) )
21
21
}
22
22
23
23
export default class VueWrapper extends Wrapper implements BaseWrapper {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import ComponentWithTransitionGroup from '~resources/components/component-with-transition-group.vue'
2
+ import TransitionGroupStub from '~src/components/TransitionGroupStub'
3
+ import { mount } from '~vue-test-utils'
4
+
5
+ describe ( 'TransitionGroupStub' , ( ) => {
6
+ it ( 'update synchronously when used as stubs for Transition' , ( ) => {
7
+ const wrapper = mount ( ComponentWithTransitionGroup , {
8
+ stubs : {
9
+ 'transition-group' : TransitionGroupStub
10
+ }
11
+ } )
12
+ expect ( wrapper . text ( ) ) . contains ( 'a' )
13
+ wrapper . setData ( { a : 'b' } )
14
+ expect ( wrapper . text ( ) ) . contains ( 'b' )
15
+ } )
16
+
17
+ it ( 'updates watchers' , ( ) => {
18
+ const TestComponent = {
19
+ data : ( ) => ( {
20
+ someWatchedData : null ,
21
+ someData : null
22
+ } ) ,
23
+ watch : {
24
+ someWatchedData ( newData ) {
25
+ console . log ( 'asd' )
26
+ this . someData = newData
27
+ }
28
+ } ,
29
+ template : `
30
+ <transition-group
31
+ mode="out-in"
32
+ class="body"
33
+ tag="div"
34
+ >
35
+ {{someData}}
36
+ </transition-group>
37
+ `
38
+ }
39
+ const wrapper = mount ( TestComponent , {
40
+ stubs : {
41
+ 'transition-group' : TransitionGroupStub
42
+ }
43
+ } )
44
+ wrapper . setData ( {
45
+ someWatchedData : 'some data'
46
+ } )
47
+ expect ( wrapper . html ( ) ) . contains ( 'some data' )
48
+ } )
49
+ } )
File renamed without changes.
You can’t perform that action at this time.
0 commit comments