UNPKG

wix-style-react

Version:
18 lines 998 B
export const circularProgressBarCoreDriverFactory = ({ element }) => { const getElement = (dataHook) => element?.querySelector(`[data-hook="${dataHook}"]`); const getValue = () => !element ? null : getElement('progress-indicator')?.innerHTML; const getByLabelText = () => !element ? null : getElement('label')?.innerHTML; const driver = { exists: () => !!element, isSuccessIconDisplayed: () => !!getElement('success-icon'), isErrorIconDisplayed: () => !!getElement('error-icon'), getLabelTextContent: () => getByLabelText(), isLabelDisplayed: () => !!getElement('label'), isPercentagesProgressDisplayed: () => !!getElement('progress-indicator'), getValue: () => getValue(), isCompleted: () => getValue() === '100', isSingleElementRendered: (dataHook) => element?.querySelectorAll(`[data-hook="${dataHook}"]`).length === 1, }; return driver; }; //# sourceMappingURL=CircularProgressBarCore.driver.js.map