From b1c60d20d1b4836ebf4d55c17d19212cc356a05e Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Tue, 19 Mar 2024 10:31:21 +0100 Subject: [PATCH] Updated email error button text in case of partial email errors (#19877) fixes DES-66 In case some batches succeeded sending, the button text will be different if the email sending was partially successful. For now this uses text matching with a warning in our E2E tests because we don't have a straightforward way to check if an error is partial or not yet. --- .../modals/publish-flow/complete-with-email-error.hbs | 2 +- .../modals/publish-flow/complete-with-email-error.js | 6 ++++++ ghost/email-service/test/batch-sending-service.test.js | 9 ++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.hbs b/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.hbs index ee39f5731f..621001312e 100644 --- a/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.hbs +++ b/ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.hbs @@ -26,7 +26,7 @@
createModel({})); + + /** + * !! WARNING !! + * If the error message is changed that it no longer contains the word 'partially', + * we'll also need the frontend logic in ghost/admin/app/components/editor/modals/publish-flow/complete-with-email-error.js + */ await assert.rejects(service.sendBatches({ email: createModel({}), batches, post: createModel({}), newsletter: createModel({}) - }), /was only partially sent/); + }), /was only partially sent/); // do not change without reading the warning above + sinon.assert.callCount(sendBatch, 101); const sendBatches = sendBatch.getCalls().map(call => call.args[0].batch); assert.deepEqual(sendBatches, batches);