Skip to content

Commit

Permalink
Tests: Fixed listeners_spec.js (DST)
Browse files Browse the repository at this point in the history
closes #9188

- make timezone offsets dynamic, yey!
  • Loading branch information
kirrg001 committed Nov 7, 2018
1 parent 48eaa3e commit 3240a3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/test/integration/model/base/listeners_spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*jshint unused:false*/
var should = require('should'),
Promise = require('bluebird'),
moment = require('moment'),
sinon = require('sinon'),
moment = require('moment-timezone'),
rewire = require('rewire'),
_ = require('lodash'),
config = require('../../../../server/config'),
Expand Down Expand Up @@ -156,7 +156,7 @@ describe('Models: listeners', function () {
* The post should be still scheduled for 8PM UTC time.
* So the database UTC string must be 2017-04-19 20:00:00.
*/
scope.timezoneOffset = 180;
scope.timezoneOffset = moment.tz.zone('Etc/UTC').offset(now) - moment.tz.zone('Asia/Baghdad').offset(now);
scope.oldTimezone = 'Asia/Baghdad';
scope.newTimezone = 'Etc/UTC';

Expand Down Expand Up @@ -213,7 +213,7 @@ describe('Models: listeners', function () {
* The post should be still scheduled for 8PM UTC time.
* So the database UTC string must be 2017-04-18 11:00:00.
*/
scope.timezoneOffset = -420;
scope.timezoneOffset = moment.tz.zone('Asia/Seoul').offset(now) - moment.tz.zone('Europe/Amsterdam').offset(now);
scope.oldTimezone = 'Europe/Amsterdam';
scope.newTimezone = 'Asia/Seoul';

Expand Down Expand Up @@ -278,7 +278,7 @@ describe('Models: listeners', function () {
});
});

scope.timezoneOffset = -180;
scope.timezoneOffset = moment.tz.zone('Asia/Baghdad').offset(now) - moment.tz.zone('Etc/UTC').offset(now);
scope.oldTimezone = 'Asia/Baghdad';
scope.newTimezone = 'Etc/UTC';

Expand Down

0 comments on commit 3240a3f

Please sign in to comment.