UNPKG

wix-style-react

Version:
40 lines (36 loc) 1.25 kB
import { DataHooks } from './constants'; var colorPickerDriverFactory = function colorPickerDriverFactory(component) { var getConverter = function getConverter() { return component.$("[data-hook=\"".concat(DataHooks.converter, "\"]")); }; var getConverterTabs = function getConverterTabs() { return getConverter().$$("li"); }; return { element: function element() { return component; }, hasConverter: function hasConverter() { return getConverter().isPresent(); }, hasHexInput: function hasHexInput() { return component.$("[data-hook=\"color-picker-hex-input\"]").isPresent(); }, hasRgbInputs: function hasRgbInputs() { return component.$("[data-hook=\"color-picker-rgb-inputs\"]").isPresent(); }, hasHsbInputs: function hasHsbInputs() { return component.$("[data-hook=\"color-picker-hsb-inputs\"]").isPresent(); }, selectHexTab: function selectHexTab() { return getConverterTabs().get(0).click(); }, selectRgbTab: function selectRgbTab() { return getConverterTabs().get(1).click(); }, selectHsbTab: function selectHsbTab() { return getConverterTabs().get(2).click(); } }; }; export default colorPickerDriverFactory;