File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
test/unit/specs/directives/public Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -715,5 +715,33 @@ if (_.inBrowser) {
715
715
} , 200 )
716
716
} )
717
717
718
+ it ( 'update on bind value change' , function ( done ) {
719
+ var vm = new Vue ( {
720
+ el : el ,
721
+ template :
722
+ '<input type="radio" v-model="a" checked :value="b">' +
723
+ '<input type="radio" v-model="a" :value="c">' ,
724
+ data : {
725
+ a : 0 ,
726
+ b : 1 ,
727
+ c : 2
728
+ }
729
+ } )
730
+ // should sync inline-checked value to a
731
+ expect ( vm . a ) . toBe ( 1 )
732
+ vm . b = 3
733
+ _ . nextTick ( function ( ) {
734
+ expect ( vm . a ) . toBe ( 3 )
735
+ expect ( el . firstChild . checked ) . toBe ( true )
736
+ expect ( el . lastChild . checked ) . toBe ( false )
737
+ vm . a = 2
738
+ _ . nextTick ( function ( ) {
739
+ expect ( el . firstChild . checked ) . toBe ( false )
740
+ expect ( el . lastChild . checked ) . toBe ( true )
741
+ done ( )
742
+ } )
743
+ } )
744
+ } )
745
+
718
746
} )
719
747
}
You can’t perform that action at this time.
0 commit comments