本文整理匯總了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);
});
示例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'
);
});
示例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'
);
});
示例4: findAll
removeAt: (index: number) => {
const row = findAll('[data-test-contacts] [data-test-contact-row]')[index];
const link = row.querySelector('button')!;
return click(link);
},
示例5: findAll
all: () => findAll('[data-test-chat-message]'),