From b27c7bc707fae0d6706c8b4a9339088b7fdce38d Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Wed, 15 Mar 2023 09:45:36 +0100 Subject: [PATCH] Fixed batch sending snapshots dates no issue The snapshots contained the current date, so they broke every day. This commit fixes the issue by setting a fixed date. --- .../__snapshots__/batch-sending.test.js.snap | 16 ++++++++-------- .../services/email-service/batch-sending.test.js | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ghost/core/test/integration/services/email-service/__snapshots__/batch-sending.test.js.snap b/ghost/core/test/integration/services/email-service/__snapshots__/batch-sending.test.js.snap index f3dc582966..27834037f7 100644 --- a/ghost/core/test/integration/services/email-service/__snapshots__/batch-sending.test.js.snap +++ b/ghost/core/test/integration/services/email-service/__snapshots__/batch-sending.test.js.snap @@ -292,7 +292,7 @@ table.body figcaption a {
- By Joe Bloggs – 14 Mar 2023 – View online → + By Joe Bloggs – 1 Jan 2023 – View online →
@@ -416,7 +416,7 @@ A random test post [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] -By Joe Bloggs – 14 Mar 2023 – View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] +By Joe Bloggs – 1 Jan 2023 – View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] @@ -1196,7 +1196,7 @@ table.body figcaption a {
- By Joe Bloggs – 14 Mar 2023 – View online → + By Joe Bloggs – 1 Jan 2023 – View online →
@@ -1312,7 +1312,7 @@ This is a test post title [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] -By Joe Bloggs – 14 Mar 2023 – View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] +By Joe Bloggs – 1 Jan 2023 – View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] @@ -1659,7 +1659,7 @@ table.body figcaption a {
- By Joe Bloggs – 14 Mar 2023 – View online → + By Joe Bloggs – 1 Jan 2023 – View online →
@@ -1775,7 +1775,7 @@ A random test post [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] -By Joe Bloggs – 14 Mar 2023 – View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] +By Joe Bloggs – 1 Jan 2023 – View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] @@ -2124,7 +2124,7 @@ table.body figcaption a {
- By Joe Bloggs – 14 Mar 2023 – View online → + By Joe Bloggs – 1 Jan 2023 – View online →
@@ -2240,7 +2240,7 @@ A random test post [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] -By Joe Bloggs – 14 Mar 2023 – View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] +By Joe Bloggs – 1 Jan 2023 – View online → [http://127.0.0.1:2369/r/xxxxxx?m=member-uuid] diff --git a/ghost/core/test/integration/services/email-service/batch-sending.test.js b/ghost/core/test/integration/services/email-service/batch-sending.test.js index 2941c2c2b0..ee69ec47cf 100644 --- a/ghost/core/test/integration/services/email-service/batch-sending.test.js +++ b/ghost/core/test/integration/services/email-service/batch-sending.test.js @@ -64,7 +64,9 @@ async function createPublishedPostEmail(settings = {}, email_recipient_filter) { const updatedPost = { status: 'published', - updated_at: res.body.posts[0].updated_at + updated_at: res.body.posts[0].updated_at, + // Fixed publish date to make sure snapshots are consistent + published_at: moment(new Date(2023, 0, 1, 12)).toISOString() }; const newsletterSlug = fixtureManager.get('newsletters', 0).slug;