diff --git a/src/typeahead/test/typeahead.spec.js b/src/typeahead/test/typeahead.spec.js index 92a75de3f4..015c0a0566 100644 --- a/src/typeahead/test/typeahead.spec.js +++ b/src/typeahead/test/typeahead.spec.js @@ -3,6 +3,7 @@ describe('typeahead tests', function() { var changeInputValueTo; beforeEach(module('ui.bootstrap.typeahead')); + beforeEach(module('ngSanitize')); beforeEach(module('template/typeahead/typeahead-popup.html')); beforeEach(module('template/typeahead/typeahead-match.html')); beforeEach(module(function($compileProvider) { @@ -470,7 +471,7 @@ describe('typeahead tests', function() { expect($scope.isNoResults).toBeFalsy(); })); }); - + describe('select on exact match', function() { it('should select on an exact match when set', function() { $scope.onSelect = jasmine.createSpy('onSelect'); @@ -478,45 +479,45 @@ describe('typeahead tests', function() { var inputEl = findInput(element); changeInputValueTo(element, 'bar'); - + expect($scope.result).toEqual('bar'); expect(inputEl.val()).toEqual('bar'); expect(element).toBeClosed(); expect($scope.onSelect).toHaveBeenCalled(); }); - + it('should not select on an exact match by default', function() { $scope.onSelect = jasmine.createSpy('onSelect'); var element = prepareInputEl('
'); var inputEl = findInput(element); - + changeInputValueTo(element, 'bar'); - + expect($scope.result).toBeUndefined(); expect(inputEl.val()).toEqual('bar'); expect($scope.onSelect.calls.any()).toBe(false); }); - + it('should not be case sensitive when select on an exact match', function() { $scope.onSelect = jasmine.createSpy('onSelect'); var element = prepareInputEl('
'); var inputEl = findInput(element); changeInputValueTo(element, 'BaR'); - + expect($scope.result).toEqual('bar'); expect(inputEl.val()).toEqual('bar'); expect(element).toBeClosed(); expect($scope.onSelect).toHaveBeenCalled(); }); - + it('should not auto select when not a match with one potential result left', function() { $scope.onSelect = jasmine.createSpy('onSelect'); var element = prepareInputEl('
'); var inputEl = findInput(element); changeInputValueTo(element, 'fo'); - + expect($scope.result).toBeUndefined(); expect(inputEl.val()).toEqual('fo'); expect($scope.onSelect.calls.any()).toBe(false); diff --git a/src/typeahead/typeahead.js b/src/typeahead/typeahead.js index 621a498e2f..192801d3bf 100644 --- a/src/typeahead/typeahead.js +++ b/src/typeahead/typeahead.js @@ -1,4 +1,4 @@ -angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position']) +angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap.bindHtml']) /** * A helper service that can parse typeahead's syntax (string provided by users)