mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 01:20:24 +03:00
Created UseExistingIfFoundInfoIcon test
This commit is contained in:
parent
2e452993ff
commit
7eeed76539
2 changed files with 24 additions and 0 deletions
|
@ -59,6 +59,7 @@ describe('<CreateShortUrl />', () => {
|
|||
validSince: validSince.format(),
|
||||
validUntil: validUntil.format(),
|
||||
maxVisits: '20',
|
||||
findIfExists: false,
|
||||
},
|
||||
]
|
||||
);
|
||||
|
|
23
test/short-urls/UseExistingIfFoundInfoIcon.test.js
Normal file
23
test/short-urls/UseExistingIfFoundInfoIcon.test.js
Normal 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);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue