decide.nolog.cz/tests/pages/helpers.js
2023-10-15 20:37:03 +02:00

13 lines
325 B
JavaScript

import { findElementWithAssert } from 'ember-cli-page-object';
export function hasFocus(selector, options = {}) {
return {
isDescriptor: true,
get() {
let [el] = findElementWithAssert(this, selector, options);
let document = el.ownerDocument;
return el === document.activeElement;
},
};
}