@@ -2161,6 +2161,44 @@ describe('ui-select tests', function() {
2161
2161
expect ( el . scope ( ) . $select . multiple ) . toBe ( true ) ;
2162
2162
} ) ;
2163
2163
2164
+ it ( 'should have tolerance for undefined values' , function ( ) {
2165
+
2166
+ scope . modelValue = undefined ;
2167
+
2168
+ var el = compileTemplate (
2169
+ '<ui-select multiple ng-model="modelValue" theme="bootstrap" style="width: 800px;"> \
2170
+ <ui-select-match placeholder="Pick one...">{{$item.name}} <{{$item.email}}></ui-select-match> \
2171
+ <ui-select-choices repeat="person.email as person in people | filter: $select.search"> \
2172
+ <div ng-bind-html="person.name | highlight: $select.search"></div> \
2173
+ <div ng-bind-html="person.email | highlight: $select.search"></div> \
2174
+ </ui-select-choices> \
2175
+ </ui-select> \
2176
+ '
2177
+ ) ;
2178
+
2179
+ expect ( $ ( el ) . scope ( ) . $select . selected ) . toEqual ( [ ] ) ;
2180
+
2181
+ } ) ;
2182
+
2183
+ it ( 'should have tolerance for null values' , function ( ) {
2184
+
2185
+ scope . modelValue = null ;
2186
+
2187
+ var el = compileTemplate (
2188
+ '<ui-select multiple ng-model="modelValue" theme="bootstrap" style="width: 800px;"> \
2189
+ <ui-select-match placeholder="Pick one...">{{$item.name}} <{{$item.email}}></ui-select-match> \
2190
+ <ui-select-choices repeat="person.email as person in people | filter: $select.search"> \
2191
+ <div ng-bind-html="person.name | highlight: $select.search"></div> \
2192
+ <div ng-bind-html="person.email | highlight: $select.search"></div> \
2193
+ </ui-select-choices> \
2194
+ </ui-select> \
2195
+ '
2196
+ ) ;
2197
+
2198
+ expect ( $ ( el ) . scope ( ) . $select . selected ) . toEqual ( [ ] ) ;
2199
+
2200
+ } ) ;
2201
+
2164
2202
it ( 'should allow paste tag from clipboard' , function ( ) {
2165
2203
scope . taggingFunc = function ( name ) {
2166
2204
return {
0 commit comments