mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-18 13:33:51 +00:00
Created UseExistingIfFoundInfoIcon test
This commit is contained in:
@@ -59,6 +59,7 @@ describe('<CreateShortUrl />', () => {
|
|||||||
validSince: validSince.format(),
|
validSince: validSince.format(),
|
||||||
validUntil: validUntil.format(),
|
validUntil: validUntil.format(),
|
||||||
maxVisits: '20',
|
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);
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user