File tree 1 file changed +8
-3
lines changed
test/unit/features/directives
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -168,20 +168,25 @@ describe('Directive v-bind', () => {
168
168
169
169
it ( '.sync modifier with kebab case event' , done => {
170
170
const vm = new Vue ( {
171
- template : `<test :foo-bar.sync="bar"/>` ,
171
+ template : `<test ref="test" :foo-bar.sync="bar"/>` ,
172
172
data : {
173
173
bar : 1
174
174
} ,
175
175
components : {
176
176
test : {
177
177
props : [ 'fooBar' ] ,
178
- template : `<div @click="$emit('update:foo-bar', 2)">{{ fooBar }}</div>`
178
+ template : `<div>{{ fooBar }}</div>` ,
179
+ methods : {
180
+ update ( ) {
181
+ this . $emit ( 'update:foo-bar' , 2 )
182
+ }
183
+ }
179
184
}
180
185
}
181
186
} ) . $mount ( )
182
187
183
188
expect ( vm . $el . textContent ) . toBe ( '1' )
184
- triggerEvent ( vm . $el , 'click' )
189
+ vm . $refs . test . update ( )
185
190
waitForUpdate ( ( ) => {
186
191
expect ( vm . $el . textContent ) . toBe ( '2' )
187
192
} ) . then ( done )
You can’t perform that action at this time.
0 commit comments