0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/test/unit/utils/mobiledoc-converter_spec.js
Hannah Wolfe 47e00900cc 💄 🐷 Test consistency (#8199)
no issue

- change out should.equal for // jshint ignore:line
- ensure should is the first require in every test, and ALWAYS require
- make sinon the second require, and sandbox the last thing
- ALWAYS use sandbox, futureproofs tests against contributors who don't know it
- change require formatting
2017-03-21 09:24:11 +01:00

32 lines
1,017 B
JavaScript

var should = require('should'), // jshint ignore:line
converter = require('../../../server/utils/mobiledoc-converter');
describe('Convert mobiledoc to HTML ', function () {
var mobiledoc = {
version: '0.3.1',
atoms: [],
cards: [
['markdown-card',
{
pos: 'top',
card_name: 'markdown-card',
markdown: '#heading\n\n- list one\n- list two\n- list three'
}
],
['markdown-card', {
pos: 'top'
}]
],
markups: [],
sections: [
[1, 'p', [
[0, [], 0, 'test']
]],
[10, 0],
[10, 1]
]
};
it('Converts a mobiledoc to HTML', function () {
converter.render(mobiledoc).should.match('<p>test</p><div><h1 id="heading">heading</h1>\n\n<ul>\n<li>list one</li>\n<li>list two</li>\n<li>list three</li>\n</ul></div><div></div>');
});
});