File tree Expand file tree Collapse file tree 4 files changed +52
-36
lines changed Expand file tree Collapse file tree 4 files changed +52
-36
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ function update () {
1212 if ( this . $_mountingOptionsSlots ) {
1313 addSlots ( this , this . $_mountingOptionsSlots )
1414 }
15- const vnodes = this . _render ( )
16- this . _update ( vnodes )
17- this . $children . forEach ( child => update . call ( child ) )
1815 this . _watchers . forEach ( watcher => {
1916 watcher . run ( )
2017 } )
18+ const vnodes = this . _render ( )
19+ this . _update ( vnodes )
20+ this . $children . forEach ( child => update . call ( child ) )
2121}
2222
2323export 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