UNPKG

wix-style-react

Version:
26 lines (24 loc) 1.05 kB
import ReactTestUtils from 'react-dom/test-utils'; export var colorPickerDriverFactory = function colorPickerDriverFactory(_ref) { var element = _ref.element; return { exists: function exists() { return !!element; }, confirm: function confirm() { return ReactTestUtils.Simulate.click(element.querySelector('[data-hook="color-picker-confirm-button"]')); }, clickOnPreviousColor: function clickOnPreviousColor() { return ReactTestUtils.Simulate.click(element.querySelector('[data-hook="color-picker-history-previous"]')); }, historyPanelExists: function historyPanelExists() { return !!element.querySelector('[data-hook="color-picker-history"]'); }, historyCurrentColor: function historyCurrentColor() { return element.querySelector('[data-hook="color-picker-history-current"]').style.background; }, historyPreviousColor: function historyPreviousColor() { return element.querySelector('[data-hook="color-picker-history-previous"]').style.background; } }; };