@@ -817,25 +817,25 @@ describe('directive',function(){
817
817
} ) ;
818
818
} ) ;
819
819
820
- it ( 'should not clear the model when using multiple checkboxes targeting the same model array' , function ( ) {
820
+ it ( 'should not clear the model when using multiple checkboxes targeting the same model array' , function ( ) {
821
821
822
- inject ( function ( $compile , $rootScope ) {
822
+ inject ( function ( $compile , $rootScope ) {
823
823
var scope = $rootScope . $new ( ) ;
824
- scope . person = {
825
- "names" : [ "foo" ]
824
+ scope . person = {
825
+ "names" : [ "foo" ]
826
826
} ;
827
827
828
- scope . schema = {
828
+ scope . schema = {
829
829
"type" : "object" ,
830
- "properties" : {
831
- "names" : {
830
+ "properties" : {
831
+ "names" : {
832
832
"type" : "array" ,
833
- "items" : {
833
+ "items" : {
834
834
"type" : "string" ,
835
- "enum" : [ "foo" , "bar" ]
836
- }
837
- }
838
- }
835
+ "enum" : [ "foo" , "bar" ]
836
+ }
837
+ }
838
+ }
839
839
} ;
840
840
841
841
scope . form = [
@@ -848,24 +848,24 @@ describe('directive',function(){
848
848
var tmpl = angular . element ( '<form sf-schema="schema" sf-form="form" sf-model="person"></form>' ) ;
849
849
850
850
$compile ( tmpl ) ( scope ) ;
851
- $rootScope . $apply ( ) ;
852
-
851
+ $rootScope . $apply ( ) ;
852
+
853
853
var foo = tmpl . children ( ) . eq ( 0 ) . find ( 'input[type=checkbox]' ) . eq ( 0 ) ;
854
- var bar = tmpl . children ( ) . eq ( 3 ) . find ( 'input[type=checkbox]' ) . eq ( 1 ) ;
855
-
856
- foo . prop ( 'checked' ) . should . be . true ;
857
- bar . prop ( 'checked' ) . should . be . false ;
858
- scope . person . names . length . should . be . equal ( 1 ) ;
859
- scope . person . names . join ( ',' ) . should . be . equal ( 'foo' ) ;
860
-
861
- bar . click ( )
862
- scope . person . names . length . should . be . equal ( 2 ) ;
863
- scope . person . names . join ( ',' ) . should . be . equal ( 'foo,bar' ) ;
864
-
854
+ var bar = tmpl . children ( ) . eq ( 3 ) . find ( 'input[type=checkbox]' ) . eq ( 1 ) ;
855
+
856
+ foo . prop ( 'checked' ) . should . be . true ;
857
+ bar . prop ( 'checked' ) . should . be . false ;
858
+ scope . person . names . length . should . be . equal ( 1 ) ;
859
+ scope . person . names . join ( ',' ) . should . be . equal ( 'foo' ) ;
860
+
861
+ bar . click ( )
862
+ scope . person . names . length . should . be . equal ( 2 ) ;
863
+ scope . person . names . join ( ',' ) . should . be . equal ( 'foo,bar' ) ;
864
+
865
865
foo . click ( ) ;
866
866
scope . person . names . length . should . be . equal ( 1 ) ;
867
- scope . person . names . join ( ',' ) . should . be . equal ( 'bar' ) ;
868
- } ) ;
867
+ scope . person . names . join ( ',' ) . should . be . equal ( 'bar' ) ;
868
+ } ) ;
869
869
} ) ;
870
870
871
871
it ( 'should use radio buttons when they are wanted' , function ( ) {
@@ -2144,10 +2144,10 @@ describe('directive',function(){
2144
2144
ngModelCtrl . $valid = true ;
2145
2145
ngModelCtrl . $pristine = false ;
2146
2146
$rootScope . $apply ( ) ;
2147
- tmpl . children ( ) . eq ( 0 ) . children ( ) . eq ( 0 ) . hasClass ( 'has-success' ) . should . be . true ;
2147
+ tmpl . children ( ) . eq ( 0 ) . hasClass ( 'has-success' ) . should . be . true ;
2148
2148
scope . form [ 0 ] . disableSuccessState = true ;
2149
2149
$rootScope . $apply ( ) ;
2150
- tmpl . children ( ) . eq ( 0 ) . children ( ) . eq ( 0 ) . hasClass ( 'has-success' ) . should . be . false ;
2150
+ tmpl . children ( ) . eq ( 0 ) . hasClass ( 'has-success' ) . should . be . false ;
2151
2151
} ) ;
2152
2152
} ) ;
2153
2153
@@ -2194,10 +2194,10 @@ describe('directive',function(){
2194
2194
ngModelCtrl . $invalid = true ;
2195
2195
ngModelCtrl . $pristine = false ;
2196
2196
$rootScope . $apply ( ) ;
2197
- tmpl . children ( ) . eq ( 0 ) . children ( ) . eq ( 0 ) . hasClass ( 'has-error' ) . should . be . true ;
2197
+ tmpl . children ( ) . eq ( 0 ) . hasClass ( 'has-error' ) . should . be . true ;
2198
2198
scope . form [ 0 ] . disableErrorState = true ;
2199
2199
$rootScope . $apply ( ) ;
2200
- tmpl . children ( ) . eq ( 0 ) . children ( ) . eq ( 0 ) . hasClass ( 'has-error' ) . should . be . false ;
2200
+ tmpl . children ( ) . eq ( 0 ) . hasClass ( 'has-error' ) . should . be . false ;
2201
2201
} ) ;
2202
2202
} ) ;
2203
2203
@@ -2242,10 +2242,10 @@ describe('directive',function(){
2242
2242
ngModelCtrl . $valid = true ;
2243
2243
ngModelCtrl . $pristine = false ;
2244
2244
$rootScope . $apply ( ) ;
2245
- tmpl . children ( ) . eq ( 0 ) . children ( ) . eq ( 0 ) . hasClass ( 'has-success' ) . should . be . true ;
2245
+ tmpl . children ( ) . eq ( 0 ) . hasClass ( 'has-success' ) . should . be . true ;
2246
2246
scope . form [ 0 ] . disableSuccessState = true ;
2247
2247
$rootScope . $apply ( ) ;
2248
- tmpl . children ( ) . eq ( 0 ) . children ( ) . eq ( 0 ) . hasClass ( 'has-success' ) . should . be . false ;
2248
+ tmpl . children ( ) . eq ( 0 ) . hasClass ( 'has-success' ) . should . be . false ;
2249
2249
} ) ;
2250
2250
} ) ;
2251
2251
@@ -2292,10 +2292,10 @@ describe('directive',function(){
2292
2292
ngModelCtrl . $invalid = true ;
2293
2293
ngModelCtrl . $pristine = false ;
2294
2294
$rootScope . $apply ( ) ;
2295
- tmpl . children ( ) . eq ( 0 ) . children ( ) . eq ( 0 ) . hasClass ( 'has-error' ) . should . be . true ;
2295
+ tmpl . children ( ) . eq ( 0 ) . hasClass ( 'has-error' ) . should . be . true ;
2296
2296
scope . form [ 0 ] . disableErrorState = true ;
2297
2297
$rootScope . $apply ( ) ;
2298
- tmpl . children ( ) . eq ( 0 ) . children ( ) . eq ( 0 ) . hasClass ( 'has-error' ) . should . be . false ;
2298
+ tmpl . children ( ) . eq ( 0 ) . hasClass ( 'has-error' ) . should . be . false ;
2299
2299
} ) ;
2300
2300
} ) ;
2301
2301
0 commit comments