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


TypeScript Assertions.sAssertStructure方法代码示例

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


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

示例1:

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

      return [
        Assertions.sAssertStructure(
          'Checking initial structure',
          ApproxStructure.build((s, str, arr) => {
            return s.element('div', {
              children: [
                s.element('textarea', {
                  classes: [arr.not('my-custom-editor')]
                })
              ]
            });
          }),
          component.element()
        ),

        RepresentingSteps.sAssertRoundtrip(
          'Roundtripping before initialised',
          component,
          'foo'
        ),

        Logger.t(
          'Set to initialised',
          Step.sync(() => {
            resolveInit.set(true);
          })
        ),

        Waiter.sTryUntil(
          'Waiting for CustomEditor init',
          Assertions.sAssertStructure(
            'Checking structure after init',
            ApproxStructure.build((s, str, arr) => {
              return s.element('div', {
                children: [
                  s.element('textarea', {
                    classes: [arr.has('my-custom-editor')]
                  })
                ]
              });
            }),
            component.element()
          ),
          500,
          5000
        ),

        RepresentingSteps.sAssertRoundtrip(
          'Roundtripping after initialised',
          component,
          'bar'
        )
      ];
    },
开发者ID:tinymce,项目名称:tinymce,代码行数:56,代码来源:BasicCustomEditorTest.ts

示例2:

    (doc, body, gui, component, store) => {
      // TODO: Fix dupe with Input test. Test Ctrl+Enter.
      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') ],
                  html: str.is('LabelA')
                }),
                s.element('textarea', {
                  classes: [ arr.has('tox-textarea') ],
                  attrs: {
                    'data-alloy-tabstop': str.is('true')
                  }
                })
              ]
            });
          }),
          component.element()
        ),

        RepresentingSteps.sSetValue('basic', component, 'New-Value'),
        RepresentingSteps.sAssertComposedValue('basic', 'New-Value', component)
      ];
    },
开发者ID:tinymce,项目名称:tinymce,代码行数:29,代码来源:TextareaTest.ts

示例3: function

  const sTestDataToHtml = function (editor, data, expected) {
    const actual = Element.fromHtml(DataToHtml.dataToHtml(editor, data));

    return Waiter.sTryUntil('Wait for structure check',
      Assertions.sAssertStructure('Assert equal', expected, actual),
      10, 500);
  };
开发者ID:abstask,项目名称:tinymce,代码行数:7,代码来源:DataToHtmlTest.ts

示例4:

 }, (doc, body, gui, component, store) => {
   return [
     Assertions.sAssertStructure(
       'Assert table structure',
       ApproxStructure.fromHtml((
         '<table class="tox-dialog__table">' +
           '<thead>' +
             '<tr>' +
               '<th>one</th>' +
               '<th>two</th>' +
               '<th>three</th>' +
             '</tr>' +
           '</thead>' +
           '<tbody>' +
             '<tr>' +
               '<td>a</td>' +
               '<td>b</td>' +
               '<td>c</td>' +
             '</tr>' +
             '<tr>' +
               '<td>d</td>' +
               '<td>e</td>' +
               '<td>f</td>' +
             '</tr>' +
           '</tbody>' +
         '</table>'
       )),
       component.element()
     )
   ];
 },
开发者ID:tinymce,项目名称:tinymce,代码行数:31,代码来源:TableTest.ts

示例5:

 const sAssertHtmlStructure = (label: string, expectedHtml: string) => Assertions.sAssertStructure(label, ApproxStructure.build((s) => {
   return s.element('body', {
     children: [
       ApproxStructure.fromHtml(expectedHtml),
       s.theRest()
     ]
   });
 }), editorBody);
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:ContextMenuTest.ts

示例6: f

 const sAssertLegendBackground = (label: string, f) => Assertions.sAssertStructure(
   label + ': Checking background of legend button',
   ApproxStructure.build((s, str, arr) => {
     return s.element('span', {
       styles: {
         'background-color': f(s, str, arr)
       }
     });
   }),
   legend.element()
 );
开发者ID:tinymce,项目名称:tinymce,代码行数:11,代码来源:ColorInputTest.ts

示例7:

    (doc, body, gui, component, store) => {
      return [
        Assertions.sAssertStructure(
          'Checking initial structure',
          ApproxStructure.build((s, str, arr) => {
            return s.element('div', {
              children: [
                s.element('label', {
                  classes: [ arr.has('tox-label') ],
                  html: str.is('Dropzone Label')
                }),
                s.element('div', { })
              ]
            });
          }),
          component.element()
        ),

        Logger.t(
          'Trigger drop on zone',
          Chain.asStep(component.element(), [
            UiFinder.cFindIn('.tox-dropzone'),
            Chain.binder(component.getSystem().getByDom),
            Chain.op((zone) => {
              // TODO: Add 'drop' to NativeEvents
              AlloyTriggers.emitWith(zone, 'drop', {
                raw: {
                  dataTransfer: {
                    files: [
                      { name: 'image1.png' },
                      { name: 'image2.bmp' },
                      { name: 'image3.jpg' }
                    ]
                  }
                }
              });
            })
          ])
        ),

        Step.sync(() => {
          const zone = Composing.getCurrent(component).getOrDie(
            'Failed trying to get the zone from the container'
          );
          const filesValue = Representing.getValue(zone);
          Assertions.assertEq('Checking value of dropzone', [
            { name: 'image1.png' },
            { name: 'image3.jpg' }
          ], filesValue);
        })
      ];
    },
开发者ID:tinymce,项目名称:tinymce,代码行数:52,代码来源:DropzoneTest.ts

示例8:

 const sAssertStandardIframeContent = (frame) => {
   // TODO: See if we can match the contents inside the iframe body. That may not be possible though,
   //       as attempting to use sAssertStructure is throwing permission errors from tests
   return Assertions.sAssertStructure(
     'Checking to see that the src tag is now set on the iframe',
     ApproxStructure.build((s, str, arr) => {
       return s.element('iframe', {
         classes: [],
         attrs: {
           src: str.is('javascript:\'\'')
         }
       });
     }),
     frame.element()
   );
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:16,代码来源:IframeTest.ts


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