wix-style-react
Version:
38 lines (33 loc) • 1.21 kB
JavaScript
import { isClassExists } from '../../test/utils';
export default (function (_ref) {
var element = _ref.element;
return {
/** fulfilled if element in the DOM */
exists: function exists() {
return !!element;
},
hasClass: function hasClass(className) {
return isClassExists(element, className);
},
/** true if header background image exist */
backgroundImageExists: function backgroundImageExists() {
return !!element.querySelector('[data-hook="page-background-image"]');
},
/** true if gradient class name exist */
gradientClassNameExists: function gradientClassNameExists() {
return !!element.querySelector('[data-hook="page-gradient-class-name"]');
},
/** true if title exist in DOM */
tailExists: function tailExists() {
return !!element.querySelector('[data-hook="page-tail"]');
},
/** return container height */
gradientContainerHeight: function gradientContainerHeight() {
return element.querySelector('[data-hook="page-gradient-class-name"]').style.height;
},
/** returns html in a string form */
getPageHtml: function getPageHtml() {
return element.innerHTML;
}
};
});