本文整理汇总了TypeScript中@ephox/agar.Assertions.assertHtml方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Assertions.assertHtml方法的具体用法?TypeScript Assertions.assertHtml怎么用?TypeScript Assertions.assertHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/agar.Assertions
的用法示例。
在下文中一共展示了Assertions.assertHtml方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
const testReplaceWithSpans = function () {
Assertions.assertHtml(
'should return span around shy and nbsp',
'a<span data-mce-bogus="1" class="mce-nbsp">\u00a0</span>b<span data-mce-bogus="1" class="mce-shy">\u00AD</span>',
Nodes.replaceWithSpans('a' + nbsp + 'b' + shy)
);
};
示例2:
return Step.sync(() => {
const html = editor.getContent();
Assertions.assertHtml('Editor content should be expected html', content, html);
Assertions.assertEq('Editor should not be dirty', false, editor.isDirty());
Assertions.assertEq('UndoManager should not have any undo levels', false, editor.undoManager.hasUndo());
Assertions.assertEq('UndoManager should not have any redo levels', false, editor.undoManager.hasRedo());
Assertions.assertEq('Editor start content should match the original content', '<p><br data-mce-bogus="1"></p>', editor.startContent);
});
示例3: function
return Step.sync(function () {
const element = Replication.deep(Element.fromDom(editor.getBody()));
// Remove internal selection dom items
Arr.each(SelectorFilter.descendants(element, '*[data-mce-bogus="all"]'), Remove.remove);
Arr.each(SelectorFilter.descendants(element, '*'), function (elm) {
Attr.remove(elm, 'data-mce-selected');
});
Assertions.assertHtml('Should be expected contents', expectedContent, Html.get(element));
});
示例4: getSkinCssFilenames
const mAssertEditors = Step.stateful(function (editors, next, die) {
Assertions.assertHtml('Editor contents should be the first div content', '<p>a</p>', editors[0].getContent());
Assertions.assertHtml('Editor contents should be the second div content', '<p>b</p>', editors[1].getContent());
Assertions.assertEq('Editor container should be null', null, editors[0].editorContainer);
Assertions.assertEq('Editor container should be null', null, editors[1].editorContainer);
Assertions.assertEq(
'Should only be two skin files the skin and the content for inline mode',
['skin.min.css', 'content.inline.min.css'],
getSkinCssFilenames()
);
const targets = Arr.map(editors, function (editor) {
return editor.getElement();
});
Assertions.assertEq('Targets should be two since there are two editors', 2, targets.length);
next(targets);
});
示例5: createLocation
return Step.sync(function () {
const elm = Element.fromHtml('<div>' + html + '</div>');
const location = createLocation(elm, elementPath, offset);
const caret = Cell(null);
Assertions.assertEq('Should be a valid location: ' + html, true, location.isSome());
const pos = BoundaryCaret.renderCaret(caret, location.getOrDie()).getOrDie();
Assertions.assertHtml('Should be equal html', expectedHtml, elm.dom().innerHTML);
const container = Hierarchy.follow(elm, expectedPath);
Assertions.assertDomEq('Should be equal nodes', container.getOrDie(), Element.fromDom(pos.container()));
});
示例6:
Step.sync(function () {
const expectedContent = [
'<!DOCTYPE html>',
'<html>',
'<!--[if mso]>',
'<body class="mso-container" style="background-color:#FFFFFF;">',
'<![endif]-->',
'<!--[if !mso]><!-->',
'<body class="clean-body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #FFFFFF">',
'<!--<![endif]--><p>text</p>',
'</body>',
'</html>'
].join('\n');
Assertions.assertHtml('Styles added to iframe document', expectedContent, editor.getContent());
})
示例7: toHtml
Step.sync(function () {
const html = toHtml(editor.selection.getContent({ format: 'tree' }));
Assertions.assertHtml('Should be expected selection html', ' b ', html);
})
示例8: next
return Chain.async(function (editor: any, next, die) {
Assertions.assertHtml(label || 'Asserting editors content', expected, editor.getContent());
next(editor);
});
示例9:
return Chain.op(function () {
Assertions.assertHtml('Should equal html', expectedHtml, viewBlock.get().innerHTML);
});
示例10:
return Chain.op(function (editor) {
Assertions.assertHtml('Checking TinyMCE content', expected, editor.getContent());
});