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


TypeScript Assertions.cAssertEq方法代码示例

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


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

示例1: function

const sAssertWidthValue = function (ui, value) {
  return Waiter.sTryUntil('Wait for new width value',
    Chain.asStep({}, [
      cGetWidthValue(ui),
      Assertions.cAssertEq('Assert size value', value)
    ]), 1, 3000
  );
};
开发者ID:abstask,项目名称:tinymce,代码行数:8,代码来源:Utils.ts

示例2: cFindInDialog

const sAssertFieldValue = (ui, selector: string, value) => {
  return Waiter.sTryUntil(`Wait for new ${selector} value`,
    Chain.asStep({}, [
      cFindInDialog(ui, selector),
      UiControls.cGetValue,
      Assertions.cAssertEq(`Assert ${value} value`, value)
    ]), 20, 3000
  );
};
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:Utils.ts

示例3: function

const sAssertSourceValue = function (ui, value) {
  return Waiter.sTryUntil('Wait for source value',
    Chain.asStep({}, [
      cFindFilepickerInput(ui, 'Source'),
      UiControls.cGetValue,
      Assertions.cAssertEq('Assert source value', value)
    ]), 1, 3000
  );
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:9,代码来源:Utils.ts

示例4: TinyUi

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyUi = TinyUi(editor);

    Pipeline.async({}, [
      Logger.t('image proportion constrains should work directly', GeneralSteps.sequence([
        tinyUi.sClickOnToolbar('click image button', 'div[aria-label="Insert/edit image"] button'),
        Chain.asStep({}, [
          Chain.fromParent(tinyUi.cWaitForPopup('Wait for dialog', 'div[role="dialog"]'),
            [
              Chain.fromChains([
                UiFinder.cFindIn('i.mce-i-browse'),
                Mouse.cClick
              ]),
              Chain.fromChains([
                Chain.control(
                  Chain.fromChains([
                    UiFinder.cFindIn('input[aria-label="Width"]'),
                    UiControls.cGetValue,
                    Assertions.cAssertEq('should be 1', '1')
                  ]),
                  Guard.tryUntil('did not find input with value 1', 10, 3000)
                )
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('input[aria-label="Height"]'),
                UiControls.cSetValue('5'),
                cFakeEvent('change')
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('input[aria-label="Width"]'),
                UiControls.cGetValue,
                Assertions.cAssertEq('should have changed to 5', '5')
              ]),
              Chain.fromChains([
                UiFinder.cFindIn('div.mce-primary button'),
                Mouse.cClick
              ])
            ]
          )
        ])
      ]))

    ], onSuccess, onFailure);
  }, {
开发者ID:abstask,项目名称:tinymce,代码行数:44,代码来源:ImageResizeTest.ts

示例5: cProcessPre

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    Pipeline.async({}, [
      Logger.t('Paste pre process only', Chain.asStep(editor, [
        cProcessPre('a', true, preProcessHandler),
        Assertions.cAssertEq('Should be preprocessed by adding a X', { content: 'aX', cancelled: false })
      ])),

      Logger.t('Paste pre/post process passthough as is', Chain.asStep(editor, [
        cProcessPrePost('a', true, Fun.noop, Fun.noop),
        Assertions.cAssertEq('Should be unchanged', { content: 'a', cancelled: false })
      ])),

      Logger.t('Paste pre/post process assert internal false', Chain.asStep(editor, [
        cProcessPrePost('a', false, assertInternal(false), assertInternal(false)),
        Assertions.cAssertEq('Should be unchanged', { content: 'a', cancelled: false })
      ])),

      Logger.t('Paste pre/post process assert internal true', Chain.asStep(editor, [
        cProcessPrePost('a', true, assertInternal(true), assertInternal(true)),
        Assertions.cAssertEq('Should be unchanged', { content: 'a', cancelled: false })
      ])),

      Logger.t('Paste pre/post process alter on preprocess', Chain.asStep(editor, [
        cProcessPrePost('a', true, preProcessHandler, Fun.noop),
        Assertions.cAssertEq('Should be preprocessed by adding a X', { content: 'aX', cancelled: false })
      ])),

      Logger.t('Paste pre/post process alter on postprocess', Chain.asStep(editor, [
        cProcessPrePost('a<b>b</b>c', true, Fun.noop, postProcessHandler(editor)),
        Assertions.cAssertEq('Should have all b elements removed', { content: 'abc', cancelled: false })
      ])),

      Logger.t('Paste pre/post process alter on preprocess/postprocess', Chain.asStep(editor, [
        cProcessPrePost('a<b>b</b>c', true, preProcessHandler, postProcessHandler(editor)),
        Assertions.cAssertEq('Should have all b elements removed and have a X added', { content: 'abcX', cancelled: false })
      ])),

      Logger.t('Paste pre/post process prevent default on preProcess', Chain.asStep(editor, [
        cProcessPrePost('a<b>b</b>c', true, preventHandler, postProcessHandler(editor)),
        Assertions.cAssertEq('Should have all b elements removed and be cancelled', { content: 'a<b>b</b>c', cancelled: true })
      ])),

      Logger.t('Paste pre/post process prevent default on postProcess', Chain.asStep(editor, [
        cProcessPrePost('a<b>b</b>c', true, preProcessHandler, preventHandler),
        Assertions.cAssertEq('Should have a X added and be cancelled', { content: 'a<b>b</b>cX', cancelled: true })
      ]))
    ], onSuccess, onFailure);
  }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:48,代码来源:ProcessFiltersTest.ts

示例6: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);
    const tinyUi = TinyUi(editor);
    const doc = Element.fromDom(document);
    const body = Body.body();

    Pipeline.async({},
      Log.steps('TBA', 'Emoticons: Open dialog, verify custom categories listed and search for custom emoticon', [
        tinyApis.sFocus,
        tinyUi.sClickOnToolbar('click emoticons', 'button'),
        Chain.asStep({}, [
          tinyUi.cWaitForPopup('wait for popup', 'div[role="dialog"]'),
        ]),
        FocusTools.sTryOnSelector('Focus should start on input', doc, 'input'),
        Chain.asStep(body, [
          UiFinder.cFindIn('[role="tablist"]'),
          Assertions.cAssertStructure('check custom categories are shown', ApproxStructure.build((s, str, arr) => {
            return s.element('div', {
              children: [
                tabElement(s, str, arr)('All'),
                tabElement(s, str, arr)('People'),
                tabElement(s, str, arr)('User Defined')
              ]
            });
          })),
        ]),
        FocusTools.sSetActiveValue(doc, 'clock'),
        Chain.asStep(doc, [
          FocusTools.cGetFocused,
          cFakeEvent('input')
        ]),
        Waiter.sTryUntil(
          'Wait until clock is the first choice (search should filter)',
          Chain.asStep(body, [
            UiFinder.cFindIn('.tox-collection__item:first'),
            Chain.mapper((item) => {
              return Attr.get(item, 'data-collection-item-value');
            }),
            Assertions.cAssertEq('Search should show custom clock', '⏲')
          ]),
          100,
          1000
        ),
        Keyboard.sKeydown(doc, Keys.tab(), {}),
        FocusTools.sTryOnSelector('Focus should have moved to collection', doc, '.tox-collection__item'),
        Keyboard.sKeydown(doc, Keys.enter(), {}),
        Waiter.sTryUntil(
          'Waiting for content update',
          tinyApis.sAssertContent('<p>⏲</p>'),
          100,
          1000
        )
      ])
      , onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:55,代码来源:EmoticonAppendTest.ts

示例7: function

const sAssertEmbedData = function (ui, content) {
  return GeneralSteps.sequence([
    ui.sClickOnUi('Switch to Embed tab', '.tox-tab:contains("Embed")'),
    Waiter.sTryUntil('Textarea should have a proper value',
    Chain.asStep(Body.body(), [
      cFindInDialog(selectors.embed)(ui),
      UiControls.cGetValue,
      Assertions.cAssertEq('embed content', content)
    ]), 1, 3000),
    ui.sClickOnUi('Switch to General tab', '.tox-tab:contains("General")')
  ]);
};
开发者ID:tinymce,项目名称:tinymce,代码行数:12,代码来源:Utils.ts

示例8:

    (editor: Editor, onSuccess, onFailure) => {
      const replacedElem = Element.fromDom(editor.getElement());

      Pipeline.async({ }, [
        Chain.asStep(Body.body(), [
          UiFinder.cFindIn(`#${Attr.get(replacedElem, 'id')}`),
          Chain.binder((elem) => Traverse.nextSibling(elem).fold(() => Result.error('Replaced element has no next sibling'), Result.value)),
          Chain.mapper((elem) => Class.has(elem, 'tox-tinymce')),
          Assertions.cAssertEq('Replaced element\'s next sibling has "tox-tinymce" class', true)
        ])
      ], onSuccess, onFailure);
    },
开发者ID:tinymce,项目名称:tinymce,代码行数:12,代码来源:ToxWrappingTest.ts

示例9: cSetContent

 const makeStep = (config, label, expected) => {
   return Chain.asStep({}, [
     McEditor.cFromSettings(config),
     NamedChain.asChain([
       NamedChain.direct(NamedChain.inputName(), Chain.identity, 'editor'),
       NamedChain.direct('editor', cSetContent('<p>Hello world!</p>'), ''),
       NamedChain.direct('editor', cGetBodyDir, 'editorBodyDirectionality'),
       NamedChain.direct('editorBodyDirectionality', Assertions.cAssertEq(label, expected), 'assertion'),
       NamedChain.output('editor')
     ]),
     McEditor.cRemove
   ]);
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:InitContentBodyDirectionalityTest.ts


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