From a2278203a95b00eb40a81d17eb22bd40f3b6f813 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 29 Jan 2025 18:18:51 +0000 Subject: [PATCH] Updated tests for new Koenig version --- ghost/admin/package.json | 4 ++-- .../email-service/__snapshots__/cards.test.js.snap | 4 ++-- .../test/integration/services/email-service/cards.test.js | 1 + .../unit/api/canary/utils/serializers/input/posts.test.js | 2 +- yarn.lock | 8 ++++---- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ghost/admin/package.json b/ghost/admin/package.json index 1e21da93267d..771943ef303f 100644 --- a/ghost/admin/package.json +++ b/ghost/admin/package.json @@ -50,7 +50,7 @@ "@tryghost/helpers": "1.1.90", "@tryghost/kg-clean-basic-html": "4.1.5", "@tryghost/kg-converters": "1.0.8", - "@tryghost/koenig-lexical": "1.4.0", + "@tryghost/koenig-lexical": "1.5.1", "@tryghost/limit-service": "1.2.14", "@tryghost/members-csv": "0.0.0", "@tryghost/nql": "0.12.7", @@ -217,4 +217,4 @@ } } } -} \ No newline at end of file +} diff --git a/ghost/core/test/integration/services/email-service/__snapshots__/cards.test.js.snap b/ghost/core/test/integration/services/email-service/__snapshots__/cards.test.js.snap index 9b55b64890ed..08f2e843db0c 100644 --- a/ghost/core/test/integration/services/email-service/__snapshots__/cards.test.js.snap +++ b/ghost/core/test/integration/services/email-service/__snapshots__/cards.test.js.snap @@ -1834,12 +1834,12 @@ Ghost: Independent technology for modern publishingBeautiful, modern publishing

This is just a simple paragraph, no frills.

This is block quote

This is a...different block quote

This is a heading!

Here's a smaller heading.

\\"Cows
A lovely cow

A heading

and a paragraph (in markdown!)

-
+

A paragraph inside an HTML card.

And another one, with some bold text.

-

A gallery.

+

A gallery.

diff --git a/ghost/core/test/integration/services/email-service/cards.test.js b/ghost/core/test/integration/services/email-service/cards.test.js index 1ccf953cb0f9..95be60c6a950 100644 --- a/ghost/core/test/integration/services/email-service/cards.test.js +++ b/ghost/core/test/integration/services/email-service/cards.test.js @@ -191,6 +191,7 @@ describe('Can send cards via email', function () { 'extended-text', // not a card 'extended-quote', // not a card 'extended-heading', // not a card + 'call-to-action', // behind the contentVisibilityAlpha labs flag // not a card and shouldn't be present in published posts / emails 'tk', 'at-link', diff --git a/ghost/core/test/unit/api/canary/utils/serializers/input/posts.test.js b/ghost/core/test/unit/api/canary/utils/serializers/input/posts.test.js index 961f1591f79b..53f374ac60b1 100644 --- a/ghost/core/test/unit/api/canary/utils/serializers/input/posts.test.js +++ b/ghost/core/test/unit/api/canary/utils/serializers/input/posts.test.js @@ -353,7 +353,7 @@ describe('Unit: endpoints/utils/serializers/input/posts', function () { serializers.input.posts.edit(apiConfig, frame); let postData = frame.data.posts[0]; - postData.lexical.should.equal('{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"this is great feature","type":"extended-text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"type":"html","version":1,"html":"
My Custom HTML
","visibility":{"showOnEmail":true,"showOnWeb":true,"segment":""}},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"custom html preserved!","type":"extended-text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1}],"direction":null,"format":"","indent":0,"type":"root","version":1}}'); + postData.lexical.should.equal('{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"this is great feature","type":"extended-text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"type":"html","version":1,"html":"
My Custom HTML
","visibility":{"web":{"nonMember":true,"memberSegment":"status:free,status:-free"},"email":{"memberSegment":"status:free,status:-free"}}},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"custom html preserved!","type":"extended-text","version":1}],"direction":null,"format":"","indent":0,"type":"paragraph","version":1}],"direction":null,"format":"","indent":0,"type":"root","version":1}}'); }); it('throws error when HTML conversion fails', function () { diff --git a/yarn.lock b/yarn.lock index 547fde3a9c9c..13a4f34631f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7896,10 +7896,10 @@ dependencies: semver "^7.6.2" -"@tryghost/koenig-lexical@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@tryghost/koenig-lexical/-/koenig-lexical-1.4.0.tgz#b0ce10deea253b1c5d55d04aee8bc77baea2192d" - integrity sha512-JhkWdmvr+eznZC8ckdjZ7Oetx/VXt8Osu0vuCvfp1GwfCCkuOqqSp+T28hwLqS3T94hOWri/hwadq2EBWyMBnQ== +"@tryghost/koenig-lexical@1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@tryghost/koenig-lexical/-/koenig-lexical-1.5.1.tgz#1bded5bff93c4bbd5c24afd5f310756d3f26802f" + integrity sha512-znziI8FcUQMJ6vQ22VxrILm6p/ZiE8C4x3aOVwspvsNRGrVdSPQH3YsROcW0XOmuJlfLISlr8Jwocgpfwrp2lA== "@tryghost/limit-service@1.2.14": version "1.2.14"