You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
it('should clear view value after blur for typeahead-editable="false"',function(){
263
+
varelement=prepareInputEl('<div><input ng-model="result" uib-typeahead="item for item in source | filter:$viewValue" typeahead-editable="false"></div>');
264
+
varinputEl=findInput(element);
265
+
266
+
changeInputValueTo(element,'not in matches');
267
+
expect($scope.result).toEqual(undefined);
268
+
expect(inputEl.val()).toEqual('not in matches');
269
+
inputEl.blur();// input loses focus
270
+
expect($scope.result).toEqual(undefined);
271
+
expect(inputEl.val()).toEqual('');
272
+
});
273
+
274
+
it('should clear view value when no value selected for typeahead-editable="false" typeahead-select-on-blur="false"',function(){
275
+
varelement=prepareInputEl('<div><input ng-model="result" uib-typeahead="item for item in source | filter:$viewValue" typeahead-editable="false" typeahead-select-on-blur="false"></div>');
276
+
varinputEl=findInput(element);
277
+
278
+
changeInputValueTo(element,'b');
279
+
expect($scope.result).toEqual(undefined);
280
+
expect(inputEl.val()).toEqual('b');
281
+
inputEl.blur();// input loses focus
282
+
expect($scope.result).toEqual(undefined);
283
+
expect(inputEl.val()).toEqual('');
284
+
});
285
+
286
+
it('should not clear view value when there is match but no value selected for typeahead-editable="false" typeahead-select-on-blur="true"',function(){
287
+
varelement=prepareInputEl('<div><input ng-model="result" uib-typeahead="item for item in source | filter:$viewValue" typeahead-editable="false" typeahead-select-on-blur="true"></div>');
0 commit comments