@wix/design-system
Version:
@wix/design-system
18 lines • 1.25 kB
JavaScript
import ReactTestUtils from 'react-dom/test-utils';
import { DataHooks } from './constants';
import deprecationTestkitLog from '../utils/deprecationTestkitLog';
export const colorPickerDriverFactory = ({ element }) => {
deprecationTestkitLog('colorPickerTestkitFactory legacy testkit is deprecated and will be removed in next major release. Please use the ColorPickerTestkit unidriver testkit instead.');
return {
exists: () => !!element,
confirm: () => ReactTestUtils.Simulate.click(element.querySelector(`[data-hook="${DataHooks.confirmButton}"]`)),
cancel: () => ReactTestUtils.Simulate.click(element.querySelector(`[data-hook="${DataHooks.cancelButton}"]`)),
clickOnPreviousColor: () => ReactTestUtils.Simulate.click(element.querySelector(`[data-hook="${DataHooks.historyPrevious}"]`)),
historyPanelExists: () => !!element.querySelector(`[data-hook="${DataHooks.history}"]`),
historyCurrentColor: () => element.querySelector(`[data-hook="${DataHooks.historyCurrent}"]`).style
.background,
historyPreviousColor: () => element.querySelector(`[data-hook="${DataHooks.historyPrevious}"]`).style
.background,
};
};
//# sourceMappingURL=ColorPicker.driver.js.map