From 76062f769abebaea0019598a62eeb9b8a25a362d Mon Sep 17 00:00:00 2001 From: Dom Smith Date: Mon, 27 Jul 2020 23:22:43 +0200 Subject: [PATCH] test: Fix timezone issues with one of the tests Running the tests in a different timezone highlighted an area in the unit tests where we weren't mocking the timezone. This fixes that by using timezone mock to ensure the tests will still pass. --- common/presenters/move-to-meta-list-component.test.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/presenters/move-to-meta-list-component.test.js b/common/presenters/move-to-meta-list-component.test.js index e3aeafdae..f8ef580c9 100644 --- a/common/presenters/move-to-meta-list-component.test.js +++ b/common/presenters/move-to-meta-list-component.test.js @@ -1,3 +1,5 @@ +const timezoneMock = require('timezone-mock') + const i18n = require('../../config/i18n') const filters = require('../../config/nunjucks/filters') @@ -18,6 +20,7 @@ const mockMove = { describe('Presenters', function () { describe('#moveToMetaListComponent()', function () { beforeEach(function () { + timezoneMock.register('UTC') sinon.stub(filters, 'formatDateWithRelativeDay').returnsArg(0) sinon.stub(i18n, 't').returns('__translated__') })