Test that timezone is set globally

pull/1610/head
Hagen Schink 10 years ago
parent a19c09d28e
commit 218f27ea11
  1. 1
      karma.conf.js
  2. 14
      karma/tests/services/timezone-service-test.js

@ -37,6 +37,7 @@ module.exports = function(config) {
"app/assets/javascripts/angular/openproject-app.js",
"app/assets/javascripts/angular/config/work-packages-config.js",
"app/assets/javascripts/angular/config/configuration-service.js",
"app/assets/javascripts/angular/controllers/**/*.js",
"app/assets/javascripts/angular/dialogs/**/*.js",

@ -32,11 +32,18 @@ describe('TimezoneService', function() {
var TIME = '05/19/2014 11:49 AM';
var TimezoneService;
var ConfigurationService;
var isTimezoneSetStub;
var timezone;
beforeEach(module('openproject.services'));
beforeEach(module('openproject.services', 'openproject.config'));
beforeEach(inject(function(_TimezoneService_){
beforeEach(inject(function(_TimezoneService_, _ConfigurationService_){
TimezoneService = _TimezoneService_;
ConfigurationService = _ConfigurationService_;
isTimezoneSetStub = sinon.stub(ConfigurationService, "isTimezoneSet");
timezoneStub = sinon.stub(ConfigurationService, "timezone");
}));
describe('#parseDate', function() {
@ -50,7 +57,8 @@ describe('TimezoneService', function() {
var dateStub;
beforeEach(function() {
TimezoneService.setTimezone(timezone);
isTimezoneSetStub.returns(true);
timezoneStub.returns(timezone);
momentStub = sinon.stub(moment, "utc");
dateStub = sinon.stub();

Loading…
Cancel
Save