2018-10-28 22:54:14 +01:00
|
|
|
import { findElementWithAssert } from 'ember-cli-page-object';
|
2016-08-26 00:36:41 +02:00
|
|
|
|
|
|
|
export function hasFocus(selector, options = {}) {
|
|
|
|
return {
|
|
|
|
isDescriptor: true,
|
|
|
|
|
|
|
|
get() {
|
2018-10-28 22:54:14 +01:00
|
|
|
let [ el ] = findElementWithAssert(this, selector, options);
|
2016-08-26 00:36:41 +02:00
|
|
|
let document = el.ownerDocument;
|
2018-10-28 22:54:14 +01:00
|
|
|
return el === document.activeElement;
|
2016-08-26 00:36:41 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|