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.
@@ -89,10 +93,6 @@ describe('typeahead tests', function () {
89
93
90
94
it('should correctly render initial state if the "as" keyword is used',function(){
91
95
92
-
$scope.states=[
93
-
{code: 'AL',name: 'Alaska'},
94
-
{code: 'CL',name: 'California'}
95
-
];
96
96
$scope.result=$scope.states[0];
97
97
98
98
varelement=prepareInputEl("<div><input ng-model='result' typeahead='state as state.name for state in states'></div>");
@@ -228,10 +228,6 @@ describe('typeahead tests', function () {
228
228
229
229
it('should invoke select callback on select',function(){
230
230
231
-
$scope.states=[
232
-
{code: 'AL',name: 'Alaska'},
233
-
{code: 'CL',name: 'California'}
234
-
];
235
231
$scope.onSelect=function($item,$model,$label){
236
232
$scope.$item=$item;
237
233
$scope.$model=$model;
@@ -251,11 +247,6 @@ describe('typeahead tests', function () {
251
247
252
248
xit('should correctly update inputs value on mapping where label is not derived from the model',function(){
253
249
254
-
$scope.states=[
255
-
{code: 'AL',name: 'Alaska'},
256
-
{code: 'CL',name: 'California'}
257
-
];
258
-
259
250
varelement=prepareInputEl("<div><input ng-model='result' typeahead='state.code as state.name for state in states | filter:$viewValue'></div>");
260
251
varinputEl=findInput(element);
261
252
@@ -280,16 +271,18 @@ describe('typeahead tests', function () {
280
271
281
272
expect(element).toBeClosed();
282
273
});
274
+
275
+
it('issue 591 - initial formatting for un-selected match and complex label expression',function(){
276
+
277
+
varinputEl=findInput(prepareInputEl("<div><input ng-model='result' typeahead='state as state.name + \" \" + state.code for state in states | filter:$viewValue'></div>"));
278
+
expect(inputEl.val()).toEqual('');
279
+
});
283
280
});
284
281
285
282
describe('integration with existing formatters',function(){
286
283
287
284
it('should co-operate with existing formatters',function(){
288
285
289
-
$scope.states=[
290
-
{code: 'AL',name: 'Alaska'},
291
-
{code: 'CL',name: 'California'}
292
-
];
293
286
$scope.result=$scope.states[0];
294
287
295
288
varelement=prepareInputEl("<div><input ng-model='result.name' formatter typeahead='state.name for state in states | filter:$viewValue'></div>"),
@@ -298,4 +291,5 @@ describe('typeahead tests', function () {
0 commit comments