From 6d55e46b7370a5f678d73e88fe9588f8ea19c900 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 1 Jul 2020 13:33:25 +0100 Subject: [PATCH] Fixed gh-format-post-time tests refs https://github.com/TryGhost/Ghost-Admin/commit/eacf8a72d8a61b0e7c505ca6d99a7f5d94018272 - updated to reflect change of "x hours" display from <15mins to <12hrs --- .../helpers/gh-format-post-time-test.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ghost/admin/tests/integration/helpers/gh-format-post-time-test.js b/ghost/admin/tests/integration/helpers/gh-format-post-time-test.js index 13cf82f715..e1723ba2b5 100644 --- a/ghost/admin/tests/integration/helpers/gh-format-post-time-test.js +++ b/ghost/admin/tests/integration/helpers/gh-format-post-time-test.js @@ -46,7 +46,7 @@ describe('Integration: Helper: gh-format-post-time', function () { expect(this.element).to.have.trimmed.text('an hour ago'); }); - it('returns difference if post was published less than 15 minutes ago', async function () { + it('returns difference if post was published less than 2 minutes ago', async function () { let mockDate = moment.utc().subtract(13, 'minutes'); this.set('mockDate', mockDate); @@ -54,7 +54,7 @@ describe('Integration: Helper: gh-format-post-time', function () { expect(this.element).to.have.trimmed.text('13 minutes ago'); }); - it('returns difference if post is scheduled for less than 15 minutes from now', async function () { + it('returns difference if post is scheduled for less than 2 minutes from now', async function () { let mockDate = moment.utc().add(13, 'minutes'); this.set('mockDate', mockDate); @@ -63,9 +63,10 @@ describe('Integration: Helper: gh-format-post-time', function () { }); it('returns correct format if post was published on the same day', async function () { + // needs to be outside of 12 hours let {mockDate, expectedTime} = setupMockDate({ - date: '2017-09-06T16:00:00Z', - utcDate: '2017-09-06T18:00:00Z' + date: '2017-09-06T06:00:00Z', + utcDate: '2017-09-06T19:00:00Z' }); this.set('mockDate', mockDate); @@ -74,9 +75,10 @@ describe('Integration: Helper: gh-format-post-time', function () { }); it('returns correct format if post is scheduled for the same day', async function () { + // needs to be outside of 12 hours let {mockDate, expectedTime} = setupMockDate({ - date: '2017-09-06T18:00:00Z', - utcDate: '2017-09-06T16:00:00Z' + date: '2017-09-06T06:00:00Z', + utcDate: '2017-09-06T19:00:00Z' }); this.set('mockDate', mockDate);