Skip to content

Commit

Permalink
test: Fix timezone issues with one of the tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
teneightfive committed Jul 28, 2020
1 parent 43fd58b commit 76062f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/presenters/move-to-meta-list-component.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const timezoneMock = require('timezone-mock')

const i18n = require('../../config/i18n')
const filters = require('../../config/nunjucks/filters')

Expand All @@ -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__')
})
Expand Down

0 comments on commit 76062f7

Please sign in to comment.