Ghost/ghost/core/test/utils
Chris Raible c90e033fcf
Added an email rendering test for all Koenig cards (#19059)
refs TryGhost/Product#4125

This PR adds two new integration tests to ensure all our Koenig cards
are rendered properly after going through the EmailRenderer. Although we
have thorough tests for the cards themselves in the Koenig repo, the
EmailRenderer does post-processing on the rendered HTML, such as
inlining CSS, which can adversely impact the rendered output of our
cards in email clients (usually Outlook).

Since email newsletters are a core feature of Ghost, these bugs are
typically fairly urgent, and since it is email, they are also quite
difficult to troubleshoot and fix. These two tests are intended to
prevent bugs of this sort, which in the past have been created by
seemingly harmless changes like bumping dependencies that are used in
the EmailRenderer.

The idea is to create a 'Golden Post' which has at least 1 of every card
from Koenig, run that post through the EmailRenderer, and take a
snapshot of the rendered HTML. In the future, if we make any changes to
the EmailRenderer or the Koenig cards themselves, this will trigger us
to carefully consider the changes, and it provides an 'expected' output
to compare our changes against.

Additionally, the second test simply checks that all cards from
`kg-default-nodes` are included in the 'Golden Post'. This protects
against any new cards that we will add in the future — as soon as we add
them to Koenig and bump `kg-default-nodes` in Ghost, this test will
fail, prompting us to add the new card to the Golden Post and update the
snapshots.

We should also run the 'Golden Post' through a test in Litmus, which
allows us to visually inspect the rendered email across many different
email clients. Ideally we would create a process to review the output of
the 'Golden Post' in Litmus whenever we update the snapshot as well.
2023-12-12 16:05:04 -08:00
..
agents Sped up comments and feedback tests by reusing Ghost app instance 2022-11-18 14:58:35 +01:00
fixtures Added an email rendering test for all Koenig cards (#19059) 2023-12-12 16:05:04 -08:00
mocks Fixed Playwright tests for new email flow 2023-01-20 19:00:13 +01:00
admin-utils.js 🐛 Fixed missing published Admin assets when running in development 2022-08-04 10:55:35 +02:00
api.js Cleaned up lexicalEditor labs flag, switched Post model to lexical-by-default (#18607) 2023-10-23 17:51:34 +01:00
assertions.js Removed custom assertions 2023-03-10 14:29:55 +01:00
batch-email-utils.js Added email address alignment protections (#19094) 2023-11-23 10:25:30 +01:00
configUtils.js Fixed configUtils and adapter cache issues in E2E tests (#16167) 2023-01-30 14:06:20 +01:00
db-utils.js Removed Bluebird Promise.each from db.utils (#17032) 2023-06-23 09:46:41 +02:00
e2e-framework-mock-manager.js Added email address alignment protections (#19094) 2023-11-23 10:25:30 +01:00
e2e-framework.js Added Source as the new default theme 2023-10-03 14:02:08 +02:00
e2e-utils.js Added Source as the new default theme 2023-10-03 14:02:08 +02:00
fixture-utils.js Added page html reset and re-render to handle dynamic collection card content (#18265) 2023-09-21 14:51:08 +00:00
index.js 🔒 Fixed filtering on private Author fields in Content API 2023-05-03 08:43:20 -04:00
mocha-retry-reporter.js Enabled and tracked retries in CI tests (#16909) 2023-06-02 09:36:28 +02:00
overrides.js Disabled network retries for webmentions in tests (#18269) 2023-09-21 16:17:05 +02:00
redirects.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
stripe-mocker.js 🐛 Fixed handling multiple Stripe subscriptions for same member (#17773) 2023-08-22 13:27:21 +02:00
url-service-utils.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
urlUtils.js Removed all unused variables from test files 2023-03-10 14:29:55 +01:00