本文整理汇总了TypeScript中@ember/test-helpers.settled函数的典型用法代码示例。如果您正苦于以下问题:TypeScript settled函数的具体用法?TypeScript settled怎么用?TypeScript settled使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了settled函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('the message is shown, but is waiting for a confirmation', async function(assert) {
const messages = chat.messages.all();
const confirmations = chat.messages.confirmationsFor(messages[0]);
const loader = chat.messages.loaderFor(messages[0]);
const text = confirmations.map(c => c.innerHTML).join();
assert.ok(loader, 'a loader is rendererd');
assert.notOk(text.includes('could not be delivered'), 'no message is rendered yet');
percySnapshot(assert as any);
await settled();
});
示例2: test
test('wait helpers', async (assert) => {
await render(hbs`<div class="message">Hello</div>`);
await waitFor('.message', { count: 1, timeout: 10, timeoutMessage: 'uh oh' });
await waitUntil(() => 'hello', { timeout: 1000, timeoutMessage: 'boom' });
await settled();
assert.ok(isSettled());
const {
hasPendingRequests,
hasPendingTimers,
hasPendingWaiters,
hasRunLoop,
pendingRequestCount
} = getSettledState();
});
示例3: function
hooks.beforeEach(async function() {
await page.channels.form.fill('Vertical Flat Plates');
await page.channels.form.submit();
await settled();
});
示例4: function
hooks.beforeEach(async function() {
await contacts.rows.removeAt(1);
await settled();
});
示例5: function
hooks.beforeEach(async function() {
await settled();
});