mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 17:35:16 +00:00
18 lines
633 B
JavaScript
18 lines
633 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.toHaveFocus = toHaveFocus;
|
|
|
|
var _utils = require("./utils");
|
|
|
|
function toHaveFocus(element) {
|
|
(0, _utils.checkHtmlElement)(element, toHaveFocus, this);
|
|
return {
|
|
pass: element.ownerDocument.activeElement === element,
|
|
message: () => {
|
|
return [this.utils.matcherHint(`${this.isNot ? '.not' : ''}.toHaveFocus`, 'element', ''), '', 'Expected element with focus:', ` ${this.utils.printExpected(element)}`, 'Received element with focus:', ` ${this.utils.printReceived(element.ownerDocument.activeElement)}`].join('\n');
|
|
}
|
|
};
|
|
} |