From 10a4a8eb12653d9d859112cb58deecd232a0707d Mon Sep 17 00:00:00 2001 From: Sam Lord Date: Fri, 17 Feb 2023 15:08:01 +0000 Subject: [PATCH] Fixed tests for demo-data no issue --- ghost/data-generator/lib/tables/email-recipients.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/data-generator/lib/tables/email-recipients.js b/ghost/data-generator/lib/tables/email-recipients.js index f036d22381..38e6b60815 100644 --- a/ghost/data-generator/lib/tables/email-recipients.js +++ b/ghost/data-generator/lib/tables/email-recipients.js @@ -32,13 +32,13 @@ class EmailRecipientsImporter extends TableImporter { .filter(entry => entry.newsletter_id === this.model.newsletter_id) .filter(entry => new Date(entry.created_at) < earliestOpenTime) .map(memberSubscribeEvent => memberSubscribeEvent.member_id); - this.events = generateEvents({ + this.events = this.membersList.length > 0 ? generateEvents({ shape: 'ease-out', trend: 'negative', total: this.membersList.length, startTime: earliestOpenTime, endTime: currentTime < latestOpenTime ? currentTime : latestOpenTime - }); + }) : []; this.emailMeta = { emailCount: this.model.email_count, deliveredCount: this.model.delivered_count,