@@ -76,14 +76,16 @@ define(
76
76
expect ( mockScope . ngModel . filtersString ) . not . toEqual ( '' ) ;
77
77
} ) ;
78
78
79
- it ( "changing checkAll status updates the filter string " , function ( ) {
79
+ it ( "changing checkAll status sets checkAll to true " , function ( ) {
80
80
controller . checkAll ( ) ;
81
+ expect ( mockScope . ngModel . checkAll ) . toEqual ( true ) ;
81
82
expect ( mockScope . ngModel . filtersString ) . toEqual ( '' ) ;
82
83
83
84
mockScope . ngModel . checkAll = false ;
84
85
85
86
controller . checkAll ( ) ;
86
- expect ( mockScope . ngModel . filtersString ) . toEqual ( 'NONE' ) ;
87
+ expect ( mockScope . ngModel . checkAll ) . toEqual ( true ) ;
88
+ expect ( mockScope . ngModel . filtersString ) . toEqual ( '' ) ;
87
89
} ) ;
88
90
89
91
it ( "checking checkAll option resets other options" , function ( ) {
@@ -97,15 +99,16 @@ define(
97
99
} ) ;
98
100
} ) ;
99
101
100
- it ( "tells the user when no options are checked" , function ( ) {
102
+ it ( "checks checkAll when no options are checked" , function ( ) {
101
103
Object . keys ( mockScope . ngModel . checked ) . forEach ( function ( type ) {
102
104
mockScope . ngModel . checked [ type ] = false ;
103
105
} ) ;
104
106
mockScope . ngModel . checkAll = false ;
105
107
106
108
controller . updateOptions ( ) ;
107
109
108
- expect ( mockScope . ngModel . filtersString ) . toEqual ( 'NONE' ) ;
110
+ expect ( mockScope . ngModel . filtersString ) . toEqual ( '' ) ;
111
+ expect ( mockScope . ngModel . checkAll ) . toEqual ( true ) ;
109
112
} ) ;
110
113
111
114
it ( "tells the user when options are checked" , function ( ) {
@@ -116,7 +119,6 @@ define(
116
119
117
120
controller . updateOptions ( ) ;
118
121
119
- expect ( mockScope . ngModel . filtersString ) . not . toEqual ( 'NONE' ) ;
120
122
expect ( mockScope . ngModel . filtersString ) . not . toEqual ( '' ) ;
121
123
} ) ;
122
124
} ) ;
0 commit comments