META-INF.resources.bower_components.angular-bootstrap-datetimepicker.test.configuration.datetimepickerConfig.spec.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-bootstrap-date-time-picker Show documentation
Show all versions of jwebmp-bootstrap-date-time-picker Show documentation
The JWebSwing implementation for Bootstrap Date Time Picker
describe("dateimePickerConfig",function(){"use strict";var $rootScope;var $compile;beforeEach(module("ui.bootstrap.datetimepicker"));beforeEach(inject(function(_$compile_,_$rootScope_){moment.locale("en");$compile=_$compile_;$rootScope=_$rootScope_}));describe("retrieves information from",function(){it("function on scope",function(){var $scope=$rootScope.$new();$scope.date=moment("2014-11-15T00:00:00.000").toDate();$scope.configFunction=function configFunction(){return{startView:"month"}};spyOn($scope,"configFunction").and.callThrough();var element=$compile(' ')($scope);$scope.$digest();expect(jQuery(".switch",element).text()).toBe("2014");expect($scope.configFunction).toHaveBeenCalled()});it("property on scope",function(){var $scope=$rootScope.$new();$scope.date=moment("2014-11-15T00:00:00.000").toDate();$scope.config={datetimePicker:{startView:"year"}};spyOn($scope,"config").and.callThrough();var element=$compile(' ')($scope);$scope.$digest();expect(jQuery(".switch",element).text()).toBe("2010-2019")})})});