當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。