當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript test-helpers.click函數代碼示例

本文整理匯總了TypeScript中@ember/test-helpers.click函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript click函數的具體用法?TypeScript click怎麽用?TypeScript click使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了click函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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('search button triggers search with actual text', async function(this: ISearchBoxTestContext, assert) {
    const expectedSearch = 'expected search';
    let searchedWord = '';
    const onSearch = (word: string) => {
      searchedWord = word;
    };

    await getBaseTest(this, { text: expectedSearch, onSearch });
    await click(searchButtonSelector);

    assert.equal(searchedWord, expectedSearch);
  });
開發者ID:alyiwang,項目名稱:WhereHows,代碼行數:12,代碼來源:search-box-test.ts

示例3: test

  test('visiting /search and restoring facet selections', async function(assert) {
    await appLogin();
    await visit('/search?facets=(fabric%3AList(prod%2Ccorp))&keyword=car');

    assert.equal(currentURL(), '/search?facets=(fabric%3AList(prod%2Ccorp))&keyword=car');

    const { prod, corp, dev, ei } = getCheckboxes(this);
    const searchBar = querySelector<HTMLInputElement>(this, searchBarSelector) || { value: '' };

    assert.ok(prod.checked);
    assert.ok(corp.checked);
    assert.notOk(dev.checked);
    assert.notOk(ei.checked);
    assert.equal(searchBar.value, 'car');

    await click(getCheckboxSelector('ei'));

    assert.equal(currentURL(), '/search?facets=(fabric%3AList(prod%2Ccorp%2Cei))&keyword=car');
  });
開發者ID:alyiwang,項目名稱:WhereHows,代碼行數:19,代碼來源:search-test.ts

示例4: click

 clickNext: () => click(`[data-test-next]`),
開發者ID:NullVoxPopuli,項目名稱:emberclear,代碼行數:1,代碼來源:setup.ts

示例5: test

 test('facet changed action', async function(assert) {
   const { wasChangedCalled } = await createTest(this, { value1: true });
   assert.equal(getTextNoSpaces(this), 'Facet1clearValue11Value210');
   await click(FACET_OPTION_SELECTOR);
   assert.ok(wasChangedCalled(), 'Clear was called');
 });
開發者ID:alyiwang,項目名稱:WhereHows,代碼行數:6,代碼來源:search-facet-test.ts

示例6: async

const appLogin = async () => {
  await visit(authenticationUrl);
  await fillIn(loginUserInput, testUser);
  await fillIn(loginPasswordInput, testPassword);
  await click(loginSubmitButton);
};
開發者ID:alyiwang,項目名稱:WhereHows,代碼行數:6,代碼來源:test-login.ts

示例7: click

 open: () => click('[data-test-user-dropdown-toggle]'),
開發者ID:NullVoxPopuli,項目名稱:emberclear,代碼行數:1,代碼來源:app.ts

示例8: click

 submit: () => click(`${wrapper} [data-test-submit-login]`),
開發者ID:NullVoxPopuli,項目名稱:emberclear,代碼行數:1,代碼來源:login.ts


注:本文中的@ember/test-helpers.click函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。