wix-style-react
Version:
wix-style-react
33 lines (26 loc) • 1.2 kB
JavaScript
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
import { thumbnailDriverFactory as publicDriverFactory } from './Thumbnail.driver';
export var thumbnailPrivateDriverFactory = function thumbnailPrivateDriverFactory(base) {
var byHook = function byHook(hook) {
return base.$('[data-hook*="' + hook + '"]');
};
var publicDriver = publicDriverFactory(base);
return _extends({}, publicDriver, {
/** Does the title exist */
titleExists: function titleExists() {
return byHook('thumbnail-title').exists();
},
/** Does the description exist */
descriptionExists: function descriptionExists() {
return byHook('thumbnail-description').exists();
},
/** Does the selected icon exist */
selectedIconExists: function selectedIconExists() {
return !!publicDriver.getSelectedIcon();
},
/** Does the thumbnails image exist */
imageExists: function imageExists() {
return byHook('thumbnail-image').exists();
}
});
};