wix-style-react
Version:
wix-style-react
38 lines (34 loc) • 1.74 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 { baseUniDriverFactory } from 'wix-ui-test-utils/base-driver';
import { buttonDriverFactory } from '../Button/Button.driver';
export var calendarPanelFooterDriverFactory = function calendarPanelFooterDriverFactory(base) {
var getByDataHook = function getByDataHook(dataHook) {
return base.$('[data-hook=' + dataHook + ']');
};
var getButton = function getButton(dataHook) {
var buttonElem = getByDataHook(dataHook);
return buttonDriverFactory(buttonElem);
};
var primaryButtonDataHook = 'primary-action-button';
var secondaryButtonDataHook = 'secondary-action-button';
return _extends({}, baseUniDriverFactory(base), {
isPrimaryButtonDisabled: function isPrimaryButtonDisabled() {
return getButton(primaryButtonDataHook).isButtonDisabled();
},
getSelectedDaysText: function getSelectedDaysText() {
return getByDataHook('selected-days-text').text();
},
getPrimaryActionButtonLabel: function getPrimaryActionButtonLabel() {
return getButton(primaryButtonDataHook).getButtonTextContent();
},
getSecondaryActionButtonLabel: function getSecondaryActionButtonLabel() {
return getButton(secondaryButtonDataHook).getButtonTextContent();
},
clickOnPrimaryButton: function clickOnPrimaryButton() {
return getButton(primaryButtonDataHook).click();
},
clickOnSecondaryButton: function clickOnSecondaryButton() {
return getButton(secondaryButtonDataHook).click();
}
});
};