Ghost/ghost/core/test/integration/services/email-service
Steve Larson 8f3985bc66
Reverted email analytics jobs commits (#20835)
ref https://linear.app/tryghost/issue/ENG-1518

After releasing the analytics job improvements, it appears for large
sites we're awfully close to missing some Mailgun events because of an
unexpected behavior of the aggregateStats call for just the opened
events job. This is taking 2-5x(+) the amount of time that the aggregate
queries take for the other jobs, despite not being dependent on the
events.

To err on the side of caution, we're going to roll this back and look to
optimize the aggregation queries before re-implementing. And we may be a
bit more cautious in giving _some_ but not _all_ priority to the
`opened` events.
2024-08-27 16:15:34 -05:00
..
__snapshots__ Fixed email integration tests (#20799) 2024-08-20 15:12:53 +00:00
batch-sending.test.js Fixed email integration tests (#20799) 2024-08-20 15:12:53 +00:00
cards.test.js Update Koenig packages 2024-08-14 15:34:44 +01:00
email-event-storage.test.js Reverted email analytics jobs commits (#20835) 2024-08-27 16:15:34 -05:00
README.md Added an email rendering test for all Koenig cards (#19059) 2023-12-12 16:05:04 -08:00

What is a golden post?

The golden post is a single lexical post that has at least one example of every card that is available in the Koenig editor (with a few exceptions for cards that should never make it into an email). We have run into problems in the past where a small change to a particular card or to the EmailRenderer itself results in seriously mangled email rendering in one or more clients (usually Outlook).

How do I update the golden post to include a new card?

If you're seeing a failing test like The golden post does not contain the ${card} card, that means that you (or someone else) has added a new node to @tryghost/kg-default-nodes that is not currently represented in the golden post. This test is here to trigger a review of the rendered email of the new card, to make sure it doesn't break the formatting in email clients. To update this test properly, please do the following:

  1. Create a card in the lexical editor, either at koenig.ghost.org or in your local Koenig repo
  2. Use the JSON Output in the bottom right of the demo to copy the lexical payload for the new card
  3. Paste the lexical payload for the card as a top level child of the root node in the golden post fixture at ghost/core/test/utils/fixtures/email-service/golden-post.json
  4. Re-run your tests with UPDATE_SNAPSHOT=1 set to update the snapshot to include the new card
  5. Update (or recreate) the Golden Post on main.ghost.org using the golden-post.json string.
  6. Send a test email to Litmus and examine the rendered output to ensure everything looks right on different clients.