UNPKG

wix-style-react

Version:
32 lines (24 loc) 1.13 kB
import { dataHooks } from './constants'; import { linearProgressBarUniDriverFactory as coreLinearProgressBarUniDriverFactory } from 'wix-ui-core/dist/src/components/linear-progress-bar/LinearProgressBar.uni.driver'; import { statusIndicatorDriverFactory } from '../StatusIndicator/StatusIndicator.uni.driver'; export const linearProgressBarDriverFactory = (base, body) => { const statusIndicatorTestkit = () => statusIndicatorDriverFactory( base.$(`[data-hook="${dataHooks.errorIcon}"]`), body, ); const coreProgressBarDriver = coreLinearProgressBarUniDriverFactory(base); return { ...coreProgressBarDriver, /** Checks whether error icon is shown */ isErrorIconShown: () => base.$(`[data-hook=${dataHooks.errorIcon}]`).exists(), /** Checks whether success icon is shown */ isSuccessIconShown: () => base.$(`[data-hook=${dataHooks.successIcon}]`).exists(), /** Returns the tooltip error message */ getTooltipErrorMessage: statusIndicatorTestkit().getMessage, /** Returns the linear progress bar skin */ getSkin: () => base.attr('data-skin'), }; };