All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.angular-bootstrap-datetimepicker.test.configuration.renderOn.spec.min.js Maven / Gradle / Ivy

There is a newer version: 0.66.0.1
Show newest version
describe("renderOn",function(){"use strict";var $rootScope;var $compile;beforeEach(module("ui.bootstrap.datetimepicker"));beforeEach(inject(function(_$compile_,_$rootScope_){$compile=_$compile_;$rootScope=_$rootScope_;$rootScope.date=null}));describe("throws exception",function(){it("if value is an empty string",function(){function compile(){$compile('')($rootScope);$rootScope.$digest()}expect(compile).toThrow(new Error("renderOn must not be an empty string"))});it("if value is numeric",function(){function compile(){$compile('')($rootScope);$rootScope.$digest()}expect(compile).toThrow(new Error("renderOn must be a string"))})});describe("does NOT throw exception",function(){it("if value is a string",function(){$compile('')($rootScope)})});describe("renderOn event",function(){it("causes view to re-render after event is received",function(){var selectable=true;$rootScope.config={data:{startView:"year",renderOn:"valid-dates-changed"}};$rootScope.beforeRender=function(dates){dates[2].selectable=selectable};spyOn($rootScope,"beforeRender").and.callThrough();var element=$compile('')($rootScope);$rootScope.$digest();var selectedElement=jQuery(jQuery(".year",element)[2]);expect(selectedElement.hasClass("disabled")).toBeFalsy();selectable=false;$rootScope.$broadcast("valid-dates-changed");$rootScope.$digest();expect($rootScope.beforeRender.calls.count()).toBe(2);selectedElement=jQuery(jQuery(".year",element)[2]);expect(selectedElement.hasClass("disabled")).toBeTruthy()})})});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy