diff --git a/test/regression/importer/importer_spec.js b/test/regression/importer/importer_spec.js
index 8a05855a38..1d1f7135f7 100644
--- a/test/regression/importer/importer_spec.js
+++ b/test/regression/importer/importer_spec.js
@@ -1145,6 +1145,7 @@ describe('Integration: Importer', function () {
slug: 'post1',
mobiledoc: JSON.stringify({
version: '0.3.1',
+ ghostVersion: '3.0', // 3.0 is when ghostVersion was introduced
markups: [],
atoms: [],
cards: [
@@ -1186,6 +1187,7 @@ describe('Integration: Importer', function () {
slug: 'post1',
mobiledoc: JSON.stringify({
version: '0.3.1',
+ ghostVersion: '3.0', // 3.0 is when ghostVersion was introduced
markups: [],
atoms: [],
cards: [
@@ -1207,6 +1209,7 @@ describe('Integration: Importer', function () {
slug: 'post2',
mobiledoc: JSON.stringify({
version: '0.3.1',
+ ghostVersion: '3.0',
markups: [],
atoms: [],
cards: [
@@ -1541,7 +1544,7 @@ 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].html.should.eql('This is my post content
\n');
posts[0].mobiledoc.should.eql(exportData.data.posts[0].mobiledoc);
});
});
@@ -1606,7 +1609,7 @@ describe('1.0', function () {
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].html.should.eql('Post Content
\n');
});
});
});
diff --git a/test/unit/lib/mobiledoc_spec.js b/test/unit/lib/mobiledoc_spec.js
index d6b2225760..1c90d5ae1e 100644
--- a/test/unit/lib/mobiledoc_spec.js
+++ b/test/unit/lib/mobiledoc_spec.js
@@ -22,6 +22,7 @@ describe('lib/mobiledoc', function () {
it('renders all default cards and atoms', function () {
let mobiledoc = {
version: '0.3.1',
+ ghostVersion: '0.3',
atoms: [
['soft-return', '', {}]
],
@@ -80,6 +81,29 @@ describe('lib/mobiledoc', function () {
.should.eql('One
Two
Markdown card
\nSome markdown
\nThree
Four
HTML card
\n');
});
+ it('renders according to ghostVersion', function () {
+ let mobiledoc = {
+ version: '0.3.1',
+ ghostVersion: '4.0',
+ atoms: [],
+ cards: [
+ ['markdown', {
+ markdown: '# Header One'
+ }]
+ ],
+ markups: [],
+ sections: [
+ [10, 0],
+ [1, 'h2', [
+ [0, [], 0, 'Héader Two']]
+ ]
+ ]
+ };
+
+ mobiledocLib.mobiledocHtmlRenderer.render(mobiledoc)
+ .should.eql('\nHéader Two
');
+ });
+
it('respects srcsets config', function () {
configUtils.set('imageOptimization:srcsets', false);