2019-03-17 20:14:36 +03:00
|
|
|
import React from 'react';
|
2020-08-30 20:45:17 +03:00
|
|
|
import { mount, ReactWrapper } from 'enzyme';
|
2019-03-17 20:14:36 +03:00
|
|
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
|
import { Modal } from 'reactstrap';
|
|
|
|
import UseExistingIfFoundInfoIcon from '../../src/short-urls/UseExistingIfFoundInfoIcon';
|
|
|
|
|
|
|
|
describe('<UseExistingIfFoundInfoIcon />', () => {
|
2020-08-30 20:45:17 +03:00
|
|
|
let wrapped: ReactWrapper;
|
2019-03-17 20:14:36 +03:00
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
wrapped = mount(<UseExistingIfFoundInfoIcon />);
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => wrapped.unmount());
|
|
|
|
|
|
|
|
it('shows modal when icon is clicked', () => {
|
|
|
|
const icon = wrapped.find(FontAwesomeIcon);
|
|
|
|
|
|
|
|
expect(wrapped.find(Modal).prop('isOpen')).toEqual(false);
|
|
|
|
icon.simulate('click');
|
|
|
|
expect(wrapped.find(Modal).prop('isOpen')).toEqual(true);
|
|
|
|
});
|
|
|
|
});
|