Replaced rect-color with react-colorful

This commit is contained in:
Alejandro Celaya
2022-02-16 20:07:10 +01:00
parent 23ee3d18a6
commit 71a010d5d7
5 changed files with 31 additions and 99 deletions

View File

@@ -1,7 +1,7 @@
import { shallow, ShallowWrapper } from 'enzyme';
import { Mock } from 'ts-mockery';
import { Button, Input, Modal, ModalHeader, Popover } from 'reactstrap';
import { ChromePicker } from 'react-color';
import { HexColorPicker } from 'react-colorful';
import { TagEdition } from '../../../src/tags/reducers/tagEdit';
import createEditTagModal from '../../../src/tags/helpers/EditTagModal';
import ColorGenerator from '../../../src/utils/services/ColorGenerator';
@@ -92,9 +92,9 @@ describe('<EditTagModal />', () => {
it('changes color when changing on color picker', () => {
const wrapper = createWrapper();
expect(wrapper.find(ChromePicker).prop('color')).toEqual('red');
wrapper.find(ChromePicker).simulate('change', { hex: 'blue' });
expect(wrapper.find(ChromePicker).prop('color')).toEqual('blue');
expect(wrapper.find(HexColorPicker).prop('color')).toEqual('red');
wrapper.find(HexColorPicker).simulate('change', 'blue');
expect(wrapper.find(HexColorPicker).prop('color')).toEqual('blue');
});
it('allows toggling popover with different mechanisms', () => {