How to use the ember-power-select/test-support/helpers.clickTrigger function in ember-power-select

To help you get started, we’ve selected a few ember-power-select 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 emberobserver / client / tests / helpers / qunit-assertions.js View on Github external
async function powerSelectOptions(parentSelector, dropdownSelector) {
  let originalOptions = document.querySelectorAll(`${dropdownSelector} .ember-power-select-option`);

  if (!originalOptions.length) {
    await clickTrigger(parentSelector);
  }

  let actualOptions = Array.from(document.querySelectorAll(`${dropdownSelector} .ember-power-select-option`)).map((option) => option.textContent.trim());

  if (!originalOptions.length) {
    await clickTrigger(parentSelector);
  }

  return actualOptions;
}