Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
registerAsyncHelper('datepickerSelect', async function(app, selector, selected) {
assert('`datepickerSelect` expect a Date or MomentJS object as second argument', selected);
let $selector = find(selector);
assert('`datepickerSelect` couln\'t find any element with selector: ' + selector, $selector.length);
let $trigger;
if ($selector.hasClass('ember-power-datepicker-trigger')) {
$trigger = $selector;
} else {
$trigger = find(`${selector} .ember-power-datepicker-trigger`);
assert('`datepickerSelect` couln\'t find any datepicker within the selector ' + selector, $trigger.length);
selector = `${selector} .ember-power-datepicker-trigger`;
}
await clickTrigger(selector);
await calendarSelect('.ember-power-datepicker-content', selected);
});
}