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


TypeScript agar.RawAssertions类代码示例

本文整理汇总了TypeScript中@ephox/agar.RawAssertions的典型用法代码示例。如果您正苦于以下问题:TypeScript RawAssertions类的具体用法?TypeScript RawAssertions怎么用?TypeScript RawAssertions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RawAssertions类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getStyleValue

 Logger.t('getStyleValue from image data', Step.sync(() => {
   RawAssertions.assertEq('Should not produce any styles', '', getStyleValue(normalizeCss, defaultData()));
   RawAssertions.assertEq('Should produce border width', 'border-width: 1px;', getStyleValue(normalizeCss, Merger.merge(defaultData(), { border: '1' })));
   RawAssertions.assertEq('Should produce style', 'border-style: solid;', getStyleValue(normalizeCss, Merger.merge(defaultData(), { borderStyle: 'solid' })));
   RawAssertions.assertEq('Should produce style & border', 'border-style: solid; border-width: 1px;', getStyleValue(normalizeCss, Merger.merge(defaultData(), { border: '1', borderStyle: 'solid' })));
   RawAssertions.assertEq('Should produce compact border', 'border: 2px dotted red;', getStyleValue(normalizeCss, Merger.merge(defaultData(), { style: 'border: 1px solid red', border: '2', borderStyle: 'dotted' })));
 })),
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:ImageDataTest.ts

示例2: function

 Logger.sync('getInfo ... ' + scenario.label + ', link: ' + scenario.linkHtml, function () {
   editorState.start.set(Element.fromHtml(scenario.linkHtml).dom());
   editorState.content.set(scenario.selection);
   const info = LinkBridge.getInfo(editor);
   RawAssertions.assertEq('Checking getInfo (link)', scenario.expected, Objects.narrow(info, [ 'url', 'text', 'target', 'title' ]));
   RawAssertions.assertEq('Checking link is set', true, info.link.isSome());
 });
开发者ID:abstask,项目名称:tinymce,代码行数:7,代码来源:LinkBridgeTest.ts

示例3: Editor

UnitTest.test('Editor context menu settings test', () => {
  const userItems = Settings.getContextMenu(new Editor('id', { contextmenu: 'link image' }, EditorManager));
  RawAssertions.assertEq('Should pass user specified items though', ['link', 'image'], userItems);

  const editor = new Editor('id', { }, EditorManager);
  editor.ui.registry.addContextMenu('link', {
    update: () => []
  });
  const defaultItems = Settings.getContextMenu(editor);
  RawAssertions.assertEq('Should filter out non existing default items', ['link'], defaultItems);
});
开发者ID:tinymce,项目名称:tinymce,代码行数:11,代码来源:ContextMenuSettingsTest.ts

示例4: function

UnitTest.test('atomic.tinymce.core.util.PredicateTest', () => {
  const isAbove = function (target, value) {
    return value() > target();
  };

  const isAbove5 = Fun.curry(isAbove, Fun.constant(5));
  const isAbove10 = Fun.curry(isAbove, Fun.constant(10));

  RawAssertions.assertEq('Should be extected and result', false, Predicate.and(isAbove10, isAbove5)(Fun.constant(10)));
  RawAssertions.assertEq('Should be extected and result', true, Predicate.and(isAbove10, isAbove5)(Fun.constant(30)));

  RawAssertions.assertEq('Should be extected or result', false, Predicate.or(isAbove10, isAbove5)(Fun.constant(5)));
  RawAssertions.assertEq('Should be extected or result', true, Predicate.or(isAbove10, isAbove5)(Fun.constant(15)));
  RawAssertions.assertEq('Should be extected or result', true, Predicate.or(isAbove5, isAbove10)(Fun.constant(15)));
});
开发者ID:danielpunkass,项目名称:tinymce,代码行数:15,代码来源:PredicateTest.ts

示例5: function

UnitTest.test('atomic.tinymce.plugins.visualchars.HtmlTest', function () {
  const nbsp = '\u00a0';
  const shy = '\u00AD';

  RawAssertions.assertEq(
    'should return correct span',
    '<span data-mce-bogus="1" class="mce-nbsp">' + nbsp + '</span>',
    Html.wrapCharWithSpan(nbsp)
  );

  RawAssertions.assertEq(
    'should return correct span',
    '<span data-mce-bogus="1" class="mce-shy">' + shy + '</span>',
    Html.wrapCharWithSpan(shy)
  );
});
开发者ID:abstask,项目名称:tinymce,代码行数:16,代码来源:HtmlTest.ts

示例6:

    return Step.sync(function () {
      const elm = document.createElement('div');
      elm.innerHTML = inputHtml;
      TrimNode.trimNode(dom, elm.firstChild);

      const actual = elm.innerHTML;
      RawAssertions.assertEq('is correct trimmed html', expectedTrimmedHtml, actual);
    });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:8,代码来源:TrimNodeTest.ts

示例7: Editor

  const testContentCss = (label: string, expectedContentCss: string[], inputContentCss: string[] | string | boolean) => {
    const editor = new Editor('id', {
      content_css: inputContentCss
    }, EditorManager);

    appendContentCssFromSettings(editor);

    RawAssertions.assertEq(label, expectedContentCss, editor.contentCSS);
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:ContentCssTest.ts

示例8: function

UnitTest.test('atomic.tinymce.plugins.visualchars.DataTest', function () {
  RawAssertions.assertEq(
    'should return correst selector',
    'span.mce-a,span.mce-b',
    Data.charMapToSelector({ a: 'a', b: 'b' })
  );

  RawAssertions.assertEq(
    'should return correct regexp',
    '/[ab]/',
    Data.charMapToRegExp({ a: 'a', b: 'b' }).toString()
  );

  RawAssertions.assertEq(
    'should return correct global regexp',
    '/[ab]/g',
    Data.charMapToRegExp({ a: 'a', b: 'b' }, true).toString()
  );
});
开发者ID:abstask,项目名称:tinymce,代码行数:19,代码来源:DataTest.ts

示例9: function

UnitTest.test('browser.tinymce.core.dom.TrimHtmlTest', function () {
  const serializer = DomSerializer({}, new Editor('id', {}, EditorManager));

  RawAssertions.assertEq('Should be unchanged', '<p id="a" data-mce-abc="1">a</p>', TrimHtml.trimInternal(serializer, '<p id="a" data-mce-abc="1">a</p>'));
  RawAssertions.assertEq('Should not have internal attr', '<p>a</p>', TrimHtml.trimInternal(serializer, '<p data-mce-selected="1">a</p>'));
  RawAssertions.assertEq('Should trim zwsp', '<p>ab</p>', TrimHtml.trimInternal(serializer, '<p>a' + Zwsp.ZWSP + 'b</p>'));

  RawAssertions.assertEq('Should be unchanged', '<p id="a" data-mce-abc="1">a</p>', TrimHtml.trimExternal(serializer, '<p id="a" data-mce-abc="1">a</p>'));
  RawAssertions.assertEq('Should not have internal attr', '<p>a</p>', TrimHtml.trimExternal(serializer, '<p data-mce-selected="1">a</p>'));
  RawAssertions.assertEq('Should not have zwsp', '<p>ab</p>', TrimHtml.trimExternal(serializer, '<p>a' + Zwsp.ZWSP + 'b</p>'));
});
开发者ID:danielpunkass,项目名称:tinymce,代码行数:11,代码来源:TrimHtmlTest.ts


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