當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Assertions.sAssertPresence方法代碼示例

本文整理匯總了TypeScript中@ephox/agar.Assertions.sAssertPresence方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Assertions.sAssertPresence方法的具體用法?TypeScript Assertions.sAssertPresence怎麽用?TypeScript Assertions.sAssertPresence使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@ephox/agar.Assertions的用法示例。


在下文中一共展示了Assertions.sAssertPresence方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

 ].concat(assertions.choice.map((c) => [
     Assertions.sAssertPresence(
       `${c} should NOT be present before clicking`,
       {
         [c]: 0
       },
       Element.fromDom(editor.getBody())
     ),
     Mouse.sClickOn(Body.body(), `.tox-collection__item .tox-collection__item-label:contains(${c})`),
     Assertions.sAssertPresence(
       `${c} should be present`,
       {
         [c]: 1
       },
       Element.fromDom(editor.getBody())
     )
   ]).getOr([ ])), onSuccess, onFailure);
開發者ID:tinymce,項目名稱:tinymce,代碼行數:17,代碼來源:ImportCssPluginTest.ts

示例2: TinyApis

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

    Pipeline.async({}, [
      Log.stepsAsStep('TBA', 'Removing a link with a collapsed selection', [
        tinyApis.sSetContent('<p><a href="http://tiny.cloud">tiny</a></p>'),
        tinyApis.sSetSelection([0, 0, 0], 2, [0, 0, 0], 2),
        Chain.asStep(doc, [
          tinyUi.cTriggerContextMenu('open context menu', 'a[href="http://tiny.cloud"]', '.tox-silver-sink [role="menuitem"]')
        ]),
        tinyUi.sClickOnUi('Click unlink', 'div[title="Remove link"]'),
        Assertions.sAssertPresence('Assert entire link removed', { 'a[href="http://tiny.cloud"]': 0 }, body),
      ]),
      Log.stepsAsStep('TBA', 'Removing a link with some text selected', [
        tinyApis.sSetContent('<p><a href="http://tiny.cloud">tiny</a></p>'),
        tinyApis.sSetSelection([0, 0, 0], 0, [0, 0, 0], 2),
        Chain.asStep(doc, [
          tinyUi.cTriggerContextMenu('open context menu', 'a[href="http://tiny.cloud"]', '.tox-silver-sink [role="menuitem"]')
        ]),
        tinyUi.sClickOnUi('Click unlink', 'div[title="Remove link"]'),
        Assertions.sAssertPresence('Assert entire link removed', { 'a[href="http://tiny.cloud"]': 0 }, body),
      ]),
      Log.stepsAsStep('TBA', 'Removing a link from an image', [
        tinyApis.sSetContent('<p><a href="http://tiny.cloud"><img src="http://moxiecode.cachefly.net/tinymce/v9/images/logo.png" /></a></p>'),
        tinyApis.sSetSelection([0, 0], 0, [0, 0], 1),
        Chain.asStep(doc, [
          tinyUi.cTriggerContextMenu('open context menu', 'a[href="http://tiny.cloud"]', '.tox-silver-sink [role="menuitem"]')
        ]),
        tinyUi.sClickOnUi('Click unlink', 'div[title="Remove link"]'),
        Assertions.sAssertPresence('Assert entire link removed', { 'a[href="http://tiny.cloud"]': 0 }, body),
      ])
    ], onSuccess, onFailure);
  }, {
開發者ID:tinymce,項目名稱:tinymce,代碼行數:36,代碼來源:RemoveLinkTest.ts

示例3: TinyUi

    TinyLoader.setup((editor, onSuccess, onFailure) => {
      const doc = Element.fromDom(document);

      const tinyUi = TinyUi(editor);

      const sOpenStyleMenu = GeneralSteps.sequence([
        tinyUi.sClickOnToolbar('Clicking on the styleselect dropdown', 'button')
      ]);

      const navigationSteps = MenuNavigationTestUtils.generateNavigation(doc, assertions.navigation);

      Pipeline.async({}, Arr.flatten([
        [
          Assertions.sAssertPresence(
            `${assertions.choice.presence} should NOT be present`,
            {
              [assertions.choice.presence]: 0
            },
            Element.fromDom(editor.getBody())
          )
        ],
        [ sOpenStyleMenu ],
        navigationSteps,
        Arr.map(assertions.choice.keysBeforeExecute, (k) => Keyboard.sKeydown(doc, k, { })),
        [ Keyboard.sKeydown(doc, Keys.enter(), { }) ],
        [
          Assertions.sAssertPresence(
            `${assertions.choice.presence} should now be present`,
            {
              [assertions.choice.presence]: 1
            },
            Element.fromDom(editor.getBody())
          )
        ]
      ]), onSuccess, onFailure);
    }, {
開發者ID:tinymce,項目名稱:tinymce,代碼行數:36,代碼來源:ImportCssGroupsPluginTest.ts

示例4: function

 const sAssertPresense = function (selector) {
   return Assertions.sAssertPresence('Detect presense of the element', selector, TinyDom.fromDom(editor.getBody()));
 };
開發者ID:abstask,項目名稱:tinymce,代碼行數:3,代碼來源:ImageFigureLinkTest.ts

示例5: function

 const sAssertPresence = function (selector) {
   return Waiter.sTryUntil('Assert element is present',
     Assertions.sAssertPresence('Detect presence of the element', selector, TinyDom.fromDom(editor.getBody())),
     100, 1000
   );
 };
開發者ID:tinymce,項目名稱:tinymce,代碼行數:6,代碼來源:ImageFigureLinkTest.ts


注:本文中的@ephox/agar.Assertions.sAssertPresence方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。