@wix/design-system
Version:
@wix/design-system
119 lines (118 loc) • 5.57 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.marketingPageLayoutContentDriverFactory = void 0;
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _unidriver = require("../utils/test-utils/unidriver");
var _constants = require("./constants");
var _TextUni = require("../Text/Text.uni.driver");
var _HeadingUni = require("../Heading/Heading.uni.driver");
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var marketingPageLayoutContentDriverFactory = base => {
return _objectSpread(_objectSpread({}, (0, _unidriver.baseUniDriverFactory)(base)), {}, {
/** Checks whether overline exists */
hasOverline: function () {
var _hasOverline = (0, _asyncToGenerator2.default)(function* () {
return yield (0, _unidriver.findByHook)(base, _constants.dataHooks.overlineContainer).exists();
});
function hasOverline() {
return _hasOverline.apply(this, arguments);
}
return hasOverline;
}(),
/** Gets the overline text */
getOverlineText: function () {
var _getOverlineText = (0, _asyncToGenerator2.default)(function* () {
return (yield (0, _TextUni.textUniDriverFactory)(yield (0, _unidriver.findByHook)(base, _constants.dataHooks.overline))).getText();
});
function getOverlineText() {
return _getOverlineText.apply(this, arguments);
}
return getOverlineText;
}(),
/** Checks whether title exists */
hasTitle: function () {
var _hasTitle = (0, _asyncToGenerator2.default)(function* () {
return yield (0, _unidriver.findByHook)(base, _constants.dataHooks.titleContainer).exists();
});
function hasTitle() {
return _hasTitle.apply(this, arguments);
}
return hasTitle;
}(),
/** Gets the title text */
getTitleText: function () {
var _getTitleText = (0, _asyncToGenerator2.default)(function* () {
return (yield (0, _HeadingUni.headingUniDriverFactory)(yield (0, _unidriver.findByHook)(base, _constants.dataHooks.title))).getText();
});
function getTitleText() {
return _getTitleText.apply(this, arguments);
}
return getTitleText;
}(),
/** Checks whether subtitle exists */
hasSubtitle: function () {
var _hasSubtitle = (0, _asyncToGenerator2.default)(function* () {
return yield (0, _unidriver.findByHook)(base, _constants.dataHooks.subtitleContainer).exists();
});
function hasSubtitle() {
return _hasSubtitle.apply(this, arguments);
}
return hasSubtitle;
}(),
/** Gets the subtitle text */
getSubtitleText: function () {
var _getSubtitleText = (0, _asyncToGenerator2.default)(function* () {
return (yield (0, _HeadingUni.headingUniDriverFactory)(yield (0, _unidriver.findByHook)(base, _constants.dataHooks.subtitle))).getText();
});
function getSubtitleText() {
return _getSubtitleText.apply(this, arguments);
}
return getSubtitleText;
}(),
/** Checks whether content exists */
hasContent: function () {
var _hasContent = (0, _asyncToGenerator2.default)(function* () {
return yield (0, _unidriver.findByHook)(base, _constants.dataHooks.contentContainer).exists();
});
function hasContent() {
return _hasContent.apply(this, arguments);
}
return hasContent;
}(),
/** Gets the content text */
getContentText: function () {
var _getContentText = (0, _asyncToGenerator2.default)(function* () {
return (yield (0, _TextUni.textUniDriverFactory)(yield (0, _unidriver.findByHook)(base, _constants.dataHooks.content))).getText();
});
function getContentText() {
return _getContentText.apply(this, arguments);
}
return getContentText;
}(),
/** Checks whether actions exist */
hasActions: function () {
var _hasActions = (0, _asyncToGenerator2.default)(function* () {
return yield (0, _unidriver.findByHook)(base, _constants.dataHooks.actions).exists();
});
function hasActions() {
return _hasActions.apply(this, arguments);
}
return hasActions;
}(),
/** Checks whether a node with the provided predicate exists */
childExists: function () {
var _childExists = (0, _asyncToGenerator2.default)(function* (predicate) {
return base.$(predicate).exists();
});
function childExists(_x) {
return _childExists.apply(this, arguments);
}
return childExists;
}()
});
};
exports.marketingPageLayoutContentDriverFactory = marketingPageLayoutContentDriverFactory;
//# sourceMappingURL=MarketingPageLayoutContent.uni.driver.js.map