UNPKG

@wix/design-system

Version:

@wix/design-system

15 lines 776 B
import { baseUniDriverFactory } from '../utils/test-utils/unidriver'; import { DATA_HOOKS } from './LabelledElement.constants'; export const labelledElementDriverFactory = (base) => { const getLabel = () => base.$(`[data-hook="${DATA_HOOKS.label}"]`); return { ...baseUniDriverFactory(base), /** Gets the content of rendered label */ getLabelText: () => getLabel().text(), /** Checks if position the label is positioned at thetop of the input element */ isLabelAtTop: async () => (await getLabel().attr('data-top')) === 'true', /** Gets the children container UniDriver */ getChildren: () => base.$(`[data-hook="${DATA_HOOKS.childrenWrapper}"]`), }; }; //# sourceMappingURL=LabelledElement.uni.driver.js.map