Created UseExistingIfFoundInfoIcon test

This commit is contained in:
Alejandro Celaya 2019-03-17 18:14:36 +01:00
parent 2e452993ff
commit 7eeed76539
2 changed files with 24 additions and 0 deletions

View file

@ -59,6 +59,7 @@ describe('<CreateShortUrl />', () => {
validSince: validSince.format(),
validUntil: validUntil.format(),
maxVisits: '20',
findIfExists: false,
},
]
);

View file

@ -0,0 +1,23 @@
import React from 'react';
import { mount } from 'enzyme';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Modal } from 'reactstrap';
import UseExistingIfFoundInfoIcon from '../../src/short-urls/UseExistingIfFoundInfoIcon';
describe('<UseExistingIfFoundInfoIcon />', () => {
let wrapped;
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);
});
});