本文整理匯總了TypeScript中@ember/test-helpers.fillIn函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript fillIn函數的具體用法?TypeScript fillIn怎麽用?TypeScript fillIn使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了fillIn函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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('Search does not through an error when typing', async function(assert) {
await appLogin();
await visit('/');
assert.equal(currentURL(), '/browse/datasets', 'We made it to the home page in one piece');
fillIn(searchBarSelector, 'Hello darkness my old friend');
assert.ok(true, 'Did not encounter an error when filling in search bar');
});
示例3: fillIn
fillIn: (text: string) => fillIn('[data-test-chat-entry]', text),
示例4: fillIn
typeMnemonic: (mnemonic: string) => fillIn(`${wrapper} [data-test-mnemonic]`, mnemonic),
示例5: fillIn
enterName: (text: string) => fillIn(`${form} [data-test-name-field]`, text),
示例6: async
const appLogin = async () => {
await visit(authenticationUrl);
await fillIn(loginUserInput, testUser);
await fillIn(loginPasswordInput, testPassword);
await click(loginSubmitButton);
};
示例7: fillIn
fillNameField: (text: string) => fillIn(`${wrapper} [data-test-name-field]`, text),