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


TypeScript ApproxStructure.build方法代码示例

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


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

示例1: function

 const sTestEnterAtStartOfAnchorZwsp = function (tinyApis, tinyActions) {
   return Logger.t(
     'sTestEnterAtStartOfAnchorZwsp',
     GeneralSteps.sequence([
       sSetup(tinyApis, '<p><a href="#">' + Zwsp.ZWSP + 'a</a></p>', [0, 0, 0], 1),
       sEnterKey(tinyActions),
       tinyApis.sAssertContentStructure(
         ApproxStructure.build(function (s, str, arr) {
           return s.element('body', {
             children: [
               s.element('p', {
                 children: [
                   s.element('br', {
                     attrs: {
                       'data-mce-bogus': str.is('1')
                     }
                   })
                 ]
               }),
               s.element('p', {
                 children: addGeckoBr(s, str, [
                   s.element('a', {
                     attrs: {
                       'data-mce-href': str.is('#'),
                       'href': str.is('#')
                     },
                     children: [
                       s.text(str.is(Zwsp.ZWSP + 'a'))
                     ]
                   })
                 ])
               })
             ]
           });
         })
       ),
       tinyApis.sAssertSelection([1, 0, 0], 1, [1, 0, 0], 1)
     ])
   );
 };
开发者ID:abstask,项目名称:tinymce,代码行数:40,代码来源:EnterKeyAnchorTest.ts

示例2:

  const sAssertInitialIframeStructure = (component: AlloyComponent) => {
    return Assertions.sAssertStructure(
      'Checking initial structure',
      ApproxStructure.build((s, str, arr) => {
        const labelStructure = s.element('label', {
          classes: [ arr.has('tox-label') ],
          html: str.is('iframe label')
        });

        const iframeStructure = s.element('div', {
          classes: [ arr.has('tox-navobj') ],
          children: [
            s.element('div', {
              attrs: {
                'data-alloy-tabstop': str.is('true')
              }
            }),
            s.element('iframe', {
              classes: [ ],
              attrs: {
                // Should be no source.
                src: str.none()
              }
            }),
            s.element('div', {
              attrs: {
                'data-alloy-tabstop': str.is('true')
              }
            })
          ]
        });

        return s.element('div', {
          classes: [ arr.has('tox-form__group') ],
          children: [ labelStructure, iframeStructure ]
        });
      }),
      component.element()
    );
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:40,代码来源:IframeTest.ts

示例3:

    (doc, body, gui, component, store) => {

      return [
        Assertions.sAssertStructure(
          'Checking initial structure',
          ApproxStructure.build((s, str, arr) => {
            return s.element('div', {
              classes: [ arr.has('tox-form__group') ],
              children: [
                s.element('label', {
                  classes: [ arr.has('tox-label') ]
                }),
                s.element('div', {
                  classes: [arr.has('tox-selectfield')],
                  children: [
                    s.element('select', {
                      attrs: {
                        size: str.is('5')
                      },
                      children: [
                        s.element('option', { value: str.is('one'), html: str.is('One') }),
                        s.element('option', { value: str.is('two'), html: str.is('Two') }),
                        s.element('option', { value: str.is('three'), html: str.is('Three')}),
                        s.element('option', { value: str.is('four'), html: str.is('Four') }),
                        s.element('option', { value: str.is('five'), html: str.is('Five') })
                      ]
                    })
                  ]
                })
              ]
            });
          }),
          component.element()
        ),

        RepresentingSteps.sSetValue('Choosing three', component, 'three'),
        DomSteps.sAssertValue('After setting "three"', 'three', component, 'select'),
        RepresentingSteps.sAssertComposedValue('Checking is three', 'three', component)
      ];
    },
开发者ID:tinymce,项目名称:tinymce,代码行数:40,代码来源:SelectboxWithSizeTest.ts

示例4: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);

    Pipeline.async({}, [
      tinyApis.sSetContent('[b]a[/b]'),
      tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
        return s.element('body', {
          children: [
            s.element('p', {
              children: [
                s.element('strong', {
                  children: [
                    s.text(str.is('a'))
                  ]
                })
              ]
            })
          ]
        });
      }))
    ], onSuccess, onFailure);
  }, {
开发者ID:abstask,项目名称:tinymce,代码行数:22,代码来源:BbcodeSanityTest.ts

示例5: TinyApis

  TinyLoader.setup(function (editor, onSuccess, onFailure) {
    const tinyApis = TinyApis(editor);

    Pipeline.async({}, Log.steps('TBA', 'BBCode: Set bbcode content and assert the equivalent html structure is present', [
      tinyApis.sSetContent('[b]a[/b]'),
      tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
        return s.element('body', {
          children: [
            s.element('p', {
              children: [
                s.element('strong', {
                  children: [
                    s.text(str.is('a'))
                  ]
                })
              ]
            })
          ]
        });
      }))
    ]), onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:22,代码来源:BbcodeSanityTest.ts

示例6: TinyUi

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

      Pipeline.async({},
        Log.steps('TBA', 'InsertDateTime: Click on Insertdatetime button and select the first item from the drop down menu. Assert date time is inserted', [
          tinyUi.sClickOnToolbar('click on insertdatetime button', '[aria-haspopup="true"]'),
          tinyUi.sWaitForUi('wait for menu', '[role="menu"]'),
          tinyUi.sClickOnUi('click on first in menu', '[role="menu"] [role="menuitemcheckbox"]:first'),
          tinyApis.sAssertContentStructure(ApproxStructure.build(function (s) {
            return s.element('body', {
              children: [
                s.element('p', {
                  children: [
                    s.element('time', {})
                  ]
                })
              ]
            });
          }))
        ])
      , onSuccess, onFailure);
    }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:23,代码来源:InsertDatetimeSanityTest.ts

示例7: TinyUi

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

    Pipeline.async({}, Log.steps('TBA', 'PageBreak: Click on the pagebreak toolbar button and assert pagebreak is inserted', [
      tinyUi.sClickOnToolbar('click on pagebreak button', 'button[aria-label="Page break"]'),
      tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str, arr) {
        return s.element('body', {
          children: [
            s.element('p', {
              children: [
                s.element('img', {
                  classes: [
                    arr.has('mce-pagebreak')
                  ]
                })
              ]
            })
          ]
        });
      }))
    ]), onSuccess, onFailure);
  }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:23,代码来源:PageBreakSanityTest.ts

示例8:

const sAssertEditorContentStructure = (editorBody, language, content) => {
  return Logger.t('Assert editor contents structure', Waiter.sTryUntil(
    'Assert content',
    Assertions.sAssertStructure(
      'Asserting editor structure',
      ApproxStructure.build((s, str, arr) => {
      return s.element('body', {
        children: [
          s.element('pre', {
            classes: [
              arr.has('language-' + language)
            ],
            attrs: {
              contenteditable: str.is('false')
            }
          }),
          s.anything()
        ]
      });
    }),
    Element.fromDom(editorBody)
  ), 100, 3000));
};
开发者ID:tinymce,项目名称:tinymce,代码行数:23,代码来源:CodeSampleTestUtils.ts

示例9: function

 const sTestEnterAtEndOfAnchorZwspWithAdjacentContent = function (tinyApis, tinyActions) {
   return Logger.t(
     'sTestEnterAtStartOfAnchorZwspWithAdjacentContent',
     GeneralSteps.sequence([
       sSetup(tinyApis, '<p>a<a href="#">b' + Zwsp.ZWSP + '</a>c</p>', [0, 1, 0], 1),
       sEnterKey(tinyActions),
       tinyApis.sAssertContentStructure(
         ApproxStructure.build(function (s, str, arr) {
           return s.element('body', {
             children: [
               s.element('p', {
                 children: [
                   s.text(str.is('a')),
                   s.element('a', {
                     attrs: {
                       'data-mce-href': str.is('#'),
                       'href': str.is('#')
                     },
                     children: [
                       s.text(str.is('b'))
                     ]
                   })
                 ]
               }),
               s.element('p', {
                 children: [
                   s.text(str.is('c'))
                 ]
               })
             ]
           });
         })
       ),
       tinyApis.sAssertSelection([1, 0], 0, [1, 0], 0)
     ])
   );
 };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:37,代码来源:EnterKeyAnchorTest.ts

示例10: TinyUi

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

    Pipeline.async({}, [
      tinyUi.sClickOnToolbar('click on emoticons button', 'div[aria-label="Emoticons"] > button'),
      tinyUi.sClickOnUi('click on kiss', 'a[aria-label="kiss"]'),
      tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
        return s.element('body', {
          children: [
            s.element('p', {
              children: [
                s.element('img', {
                  attrs: {
                    alt: str.is('kiss')
                  }
                })
              ]
            })
          ]
        });
      }))
    ], onSuccess, onFailure);
  }, {
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:24,代码来源:EmoticonSanityTest.ts


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