Sha256: 583d1df00112cd06b859fc50b5cf86572c2d0afc591b5bc71f8962bf73de9dec
Contents?: true
Size: 1.12 KB
Versions: 70
Compression:
Stored size: 1.12 KB
Contents
describe('Directive: typeahead-empty', function() { var scope, compile, element, elementScope; beforeEach(module( 'Bastion.components' )); beforeEach(inject(function(_$compile_, _$rootScope_) { compile = _$compile_; scope = _$rootScope_; })); beforeEach(function() { element = angular.element('<input ng-model="myInput" type="text" typeahead-empty />'); compile(element)(scope); scope.$digest(); elementScope = element.isolateScope(); }); it("should adjust empty string", function() { scope.myInput = ''; scope.$digest(); element.triggerHandler('focus'); expect(scope.myInput).toBe(' '); }); it("should adjust undefined", function() { scope.myInput = undefined; scope.$digest(); element.triggerHandler('focus'); expect(scope.myInput).toBe(' '); }); it("should not adjust otherss", function() { scope.myInput = 'foo'; scope.$digest(); element.triggerHandler('focus'); expect(scope.myInput).toBe('foo'); }); });
Version data entries
70 entries across 70 versions & 1 rubygems