How to use the @ember/test-helpers.getRootElement function in @ember/test-helpers

To help you get started, we’ve selected a few @ember/test-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adopted-ember-addons / ember-pikaday / addon-test-support / -private / find-all.js View on Github external
function getElements(target, rootElement = getRootElement()) {
  if (typeof target === 'string') {
    return rootElement.querySelectorAll(target);
  } else {
    throw new Error('Must use a selector string');
  }
}
github DefinitelyTyped / DefinitelyTyped / types / ember__test-helpers / ember__test-helpers-tests.ts View on Github external
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);
});