UNPKG

wix-style-react

Version:
25 lines (17 loc) 757 B
import { baseUniDriverFactory } from 'wix-ui-test-utils/base-driver'; import { dataHooks } from './constants'; export const getPrefix = base => base.$(`[data-hook="${dataHooks.prefix}"]`); export const getSuffix = base => base.$(`[data-hook="${dataHooks.suffix}"]`); export default base => { return { ...baseUniDriverFactory(base), getText: () => base.text(), /** Returns the text of the title */ getTitleText: async () => base.$(`[data-hook="${dataHooks.title}"]`).text(), getPrefix: () => getPrefix(base), getSuffix: () => getSuffix(base), hover: () => base.hover(), isSelected: async () => (await base.attr('data-selected')) === 'true', isDisabled: async () => (await base.attr('disabled')) !== null, }; };