File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
test/unit/specs/directives Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ if (_.inBrowser) {
53
53
a : 'A'
54
54
}
55
55
} ,
56
- template : '<div v-component="test" v-with="testt:test,bb:b"></div>' ,
56
+ template : '<div v-component="test" v-with="testt:test,bb:b" v-ref="child" ></div>' ,
57
57
components : {
58
58
test : {
59
59
template : '{{testt.a}} {{bb}}'
@@ -76,7 +76,16 @@ if (_.inBrowser) {
76
76
}
77
77
_ . nextTick ( function ( ) {
78
78
expect ( el . firstChild . textContent ) . toBe ( 'AAAA BBB' )
79
- done ( )
79
+ // test two-way
80
+ vm . $ . child . bb = 'B'
81
+ vm . $ . child . testt = { a : 'A' }
82
+ _ . nextTick ( function ( ) {
83
+ expect ( el . firstChild . textContent ) . toBe ( 'A B' )
84
+ expect ( vm . test . a ) . toBe ( 'A' )
85
+ expect ( vm . test ) . toBe ( vm . $ . child . testt )
86
+ expect ( vm . b ) . toBe ( 'B' )
87
+ done ( )
88
+ } )
80
89
} )
81
90
} )
82
91
} )
You can’t perform that action at this time.
0 commit comments