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


TypeScript test-helpers.findAll函数代码示例

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


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

示例1: test

test('DOM interactions', async () => {
    await render(hbs`<div class="message">Hello, world</div>`);

    await click('.message');
    await doubleClick('.message');
    await tap('.message');
    await focus('.message');
    await blur('.message');
    await triggerEvent('.message', 'custom-event');
    await triggerKeyEvent('.message', 'keydown', 'Enter', { ctrlKey: true });
    await fillIn('.message', 'content');

    const messageElement = find('.message')!;
    await click(messageElement);
    await doubleClick(messageElement);
    await tap(messageElement);
    await focus(messageElement);
    await blur(messageElement);
    await triggerEvent(messageElement, 'custom-event');
    await triggerKeyEvent(messageElement, 'keydown', 'Enter', { ctrlKey: true });
    await fillIn(messageElement, 'content');
    await typeIn(messageElement, 'content');

    const allMessages = findAll('.message');
    for (const element of allMessages) {
        await click(element);
    }

    const root = getRootElement();
    await click(root);
});
开发者ID:CNBoland,项目名称:DefinitelyTyped,代码行数:31,代码来源:ember__test-helpers-tests.ts

示例2: test

  test('component yielding with a urn', async function(assert) {
    assert.expect(1);

    const { server }: any = this;
    const upstreamCount = 3;

    server.createList('datasetView', upstreamCount);

    this.set('urn', nonHdfsUrn);

    await render(hbs`
      {{#datasets/containers/dataset-lineage-upstreams urn=urn as |container|}}
        <ul class="container-list">
          {{#each container.upstreams}}
            <li></li>
          {{/each}}
        </ul>
      {{/datasets/containers/dataset-lineage-upstreams}}
    `);

    assert.equal(
      findAll('.container-list li')!.length,
      upstreamCount,
      'expect component to yield each upstream dataset'
    );
  });
开发者ID:alyiwang,项目名称:WhereHows,代码行数:26,代码来源:dataset-lineage-upstreams-test.ts

示例3: test

  test('rendering of fabrics', async function(assert) {
    assert.expect(1);

    this.set('urn', nonHdfsUrn);

    await render(hbs`
      {{datasets/dataset-fabric-switcher urn=urn}}
    `);

    await triggerEvent(triggerSelector, 'mouseenter');

    assert.equal(
      findAll(`${contentSelector} li`).length,
      fabrics.length,
      'expected fabrics shown to equal default list of fabrics'
    );
  });
开发者ID:alyiwang,项目名称:WhereHows,代码行数:17,代码来源:dataset-fabric-switcher-test.ts

示例4: findAll

    removeAt: (index: number) => {
      const row = findAll('[data-test-contacts] [data-test-contact-row]')[index];
      const link = row.querySelector('button')!;

      return click(link);
    },
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:6,代码来源:contacts.ts

示例5: findAll

 all: () => findAll('[data-test-chat-message]'),
开发者ID:NullVoxPopuli,项目名称:emberclear,代码行数:1,代码来源:chat.ts


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