Commit fedd429c authored by Robert Knight's avatar Robert Knight

Add test that markdown editor replaces links with embeds.

parent dee38e98
...@@ -59,8 +59,14 @@ describe('markdown', function () { ...@@ -59,8 +59,14 @@ describe('markdown', function () {
toggleBlockStyle: mockFormattingCommand, toggleBlockStyle: mockFormattingCommand,
toggleSpanStyle: mockFormattingCommand, toggleSpanStyle: mockFormattingCommand,
LinkType: require('../../markdown-commands').LinkType, LinkType: require('../../markdown-commands').LinkType,
},
'../media-embedder': noCallThru({
replaceLinksWithEmbeds: function (element) {
// Tag the element as having been processed
element.dataset.replacedLinksWithEmbeds = 'yes';
},
}), }),
})); })));
}); });
beforeEach(function () { beforeEach(function () {
...@@ -110,6 +116,14 @@ describe('markdown', function () { ...@@ -110,6 +116,14 @@ describe('markdown', function () {
'rendered:Hello World'); 'rendered:Hello World');
}); });
it('should replace links with embeds in rendered output', function () {
var editor = util.createDirective(document, 'markdown', {
readOnly: true,
text: 'A video: https://www.youtube.com/watch?v=yJDv-zdhzMY',
});
assert.equal(viewElement(editor).dataset.replacedLinksWithEmbeds, 'yes');
});
it('should tolerate malformed HTML', function () { it('should tolerate malformed HTML', function () {
var editor = util.createDirective(document, 'markdown', { var editor = util.createDirective(document, 'markdown', {
readOnly: true, readOnly: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment