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
Ryan McCarvill d0dc7c5ee1 📦 Card-Rename (#8218)
no issue
- Renames Cards so they comply with the `card-{{name}}` convention rather than `{{name}}-card`
- Adds an unkonwnCardHandler to the editor.
2017-03-24 10:03:33 +00:00

34 lines
1.1 KiB
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: [
['card-markdown',
{
pos: 'top',
card_name: 'card-markdown',
markdown: '#heading\n\n- list one\n- list two\n- list three'
}
],
['card-html', {
pos: 'top',
card_name: 'card-html',
html: '<p>HTML CARD</p>'
}]
],
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 class="kg-card-markdown"><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 class="kg-card-html"><p>HTML CARD</p></div>');
});
});