当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Assertions.assertHtml方法代码示例

本文整理汇总了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)
   );
 };
开发者ID:abstask,项目名称:tinymce,代码行数:7,代码来源:NodesTest.ts

示例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);
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:EditorResetContentTest.ts

示例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));
    });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:11,代码来源:TableDeleteTest.ts

示例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);
  });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:20,代码来源:EditorInitializationTest.ts

示例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()));
    });
开发者ID:abstask,项目名称:tinymce,代码行数:13,代码来源:BoundaryCaretTest.ts

示例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());
      })
开发者ID:tinymce,项目名称:tinymce,代码行数:16,代码来源:FullPagePluginTest.ts

示例7: toHtml

 Step.sync(function () {
   const html = toHtml(editor.selection.getContent({ format: 'tree' }));
   Assertions.assertHtml('Should be expected selection html', ' b ', html);
 })
开发者ID:tinymce,项目名称:tinymce,代码行数:4,代码来源:EditorGetContentTreeTest.ts

示例8: next

 return Chain.async(function (editor: any, next, die) {
   Assertions.assertHtml(label || 'Asserting editors content', expected, editor.getContent());
   next(editor);
 });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:4,代码来源:PlainTextPasteTest.ts

示例9:

 return Chain.op(function () {
   Assertions.assertHtml('Should equal html', expectedHtml, viewBlock.get().innerHTML);
 });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:3,代码来源:MergeBlocksTest.ts

示例10:

 return Chain.op(function (editor) {
   Assertions.assertHtml('Checking TinyMCE content', expected, editor.getContent());
 });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:3,代码来源:TableAsBodyTest.ts


注:本文中的@ephox/agar.Assertions.assertHtml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。