From bb371017fecace4c1123ea01618f27b117f9cf4a Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 16 Feb 2021 12:34:27 +0000 Subject: [PATCH] Updated expected mobiledoc handling missed importer tests refs https://github.com/TryGhost/Ghost/commit/2d091fa8f9b80636e5e20e488a7e571eac551882 --- test/regression/importer/importer_spec.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/regression/importer/importer_spec.js b/test/regression/importer/importer_spec.js index db00681251..0178c47a81 100644 --- a/test/regression/importer/importer_spec.js +++ b/test/regression/importer/importer_spec.js @@ -1517,7 +1517,7 @@ describe('1.0', function () { posts.length.should.eql(1); posts[0].html.should.eql('

markdown

\n'); - posts[0].mobiledoc.should.eql('{"version":"0.3.1","markups":[],"atoms":[],"cards":[["markdown",{"markdown":"## markdown"}]],"sections":[[10,0]]}'); + posts[0].mobiledoc.should.eql('{"version":"0.3.1","markups":[],"atoms":[],"cards":[["markdown",{"markdown":"## markdown"}]],"sections":[[10,0]],"ghostVersion":"3.0"}'); }); }); @@ -1541,8 +1541,10 @@ describe('1.0', function () { const posts = result[0].data.map(model => model.toJSON(options)); posts.length.should.eql(1); - posts[0].html.should.eql('

This is my post content

\n'); - posts[0].mobiledoc.should.eql(exportData.data.posts[0].mobiledoc); + posts[0].html.should.eql('

This is my post content

\n'); + const expectedMobiledoc = JSON.parse(exportData.data.posts[0].mobiledoc); + expectedMobiledoc.ghostVersion = '3.0'; + posts[0].mobiledoc.should.eql(JSON.stringify(expectedMobiledoc)); }); }); @@ -1602,11 +1604,11 @@ describe('1.0', function () { posts.length.should.eql(2); - posts[0].mobiledoc.should.eql('{"version":"0.3.1","markups":[],"atoms":[],"cards":[["markdown",{"markdown":"## Post Content"}],["image",{"src":"source2","cardWidth":"not-wide"}]],"sections":[[10,0],[10,1]]}'); + posts[0].mobiledoc.should.eql('{"version":"0.3.1","markups":[],"atoms":[],"cards":[["markdown",{"markdown":"## Post Content"}],["image",{"src":"source2","cardWidth":"not-wide"}]],"sections":[[10,0],[10,1]],"ghostVersion":"3.0"}'); posts[0].html.should.eql('

Post Content

\n
'); - posts[1].mobiledoc.should.eql('{"version":"0.3.1","markups":[],"atoms":[],"cards":[["image",{"src":"source","cardWidth":"wide"}],["markdown",{"markdown":"# Post Content"}]],"sections":[[10,0],[10,1]]}'); - posts[1].html.should.eql('

Post Content

\n'); + posts[1].mobiledoc.should.eql('{"version":"0.3.1","markups":[],"atoms":[],"cards":[["image",{"src":"source","cardWidth":"wide"}],["markdown",{"markdown":"# Post Content"}]],"sections":[[10,0],[10,1]],"ghostVersion":"3.0"}'); + posts[1].html.should.eql('

Post Content

\n'); }); }); });