Rolled-back blurred modal

This commit is contained in:
Alejandro Celaya
2021-02-27 08:52:10 +01:00
parent 3cd30b61e4
commit 2553b27d7d
20 changed files with 43 additions and 79 deletions

View File

@@ -71,7 +71,7 @@ describe('<EditMetaModal />', () => {
it.each([
[ '.btn-link', 'onClick' ],
[ 'BlurredModal', 'toggle' ],
[ 'Modal', 'toggle' ],
[ 'ModalHeader', 'toggle' ],
])('resets meta when modal is toggled in any way', (componentToFind, propToCall) => {
const wrapper = createWrapper({ saving: false, error: false });

View File

@@ -67,7 +67,7 @@ describe('<EditShortUrlModal />', () => {
it.each([
[ '[color="link"]', 'onClick' ],
[ 'BlurredModal', 'toggle' ],
[ 'Modal', 'toggle' ],
[ 'ModalHeader', 'toggle' ],
])('toggles modal with different mechanisms', (componentToFind, propToCall) => {
const wrapper = createWrapper({}, { saving: false, error: false });

View File

@@ -4,7 +4,7 @@ import createEditTagsModal from '../../../src/short-urls/helpers/EditTagsModal';
import { ShortUrl } from '../../../src/short-urls/data';
import { ShortUrlTags } from '../../../src/short-urls/reducers/shortUrlTags';
import { OptionalString } from '../../../src/utils/utils';
import { BlurredModal } from '../../../src/utils/BlurredModal';
import { Modal } from 'reactstrap';
describe('<EditTagsModal />', () => {
let wrapper: ShallowWrapper;
@@ -98,7 +98,7 @@ describe('<EditTagsModal />', () => {
saving: false,
error: false,
});
const modal = wrapper.find(BlurredModal);
const modal = wrapper.find(Modal);
modal.simulate('closed');
expect(editShortUrlTags).not.toHaveBeenCalled();

View File

@@ -1,13 +1,12 @@
import { shallow, ShallowWrapper } from 'enzyme';
import { ExternalLink } from 'react-external-link';
import { ModalBody, ModalHeader, Row } from 'reactstrap';
import { Modal, ModalBody, ModalHeader, Row } from 'reactstrap';
import { Mock } from 'ts-mockery';
import QrCodeModal from '../../../src/short-urls/helpers/QrCodeModal';
import { ShortUrl } from '../../../src/short-urls/data';
import { ReachableServer } from '../../../src/servers/data';
import { CopyToClipboardIcon } from '../../../src/utils/CopyToClipboardIcon';
import { DropdownBtn } from '../../../src/utils/DropdownBtn';
import { BlurredModal } from '../../../src/utils/BlurredModal';
describe('<QrCodeModal />', () => {
let wrapper: ShallowWrapper;
@@ -81,7 +80,7 @@ describe('<QrCodeModal />', () => {
expect(wrapper.find('.mt-2').text()).toEqual(`${size}x${size}`);
expect(wrapper.find('label').at(0).text()).toEqual(`Size: ${size}px`);
expect(wrapper.find('label').at(1).text()).toEqual(`Margin: ${margin}px`);
expect(wrapper.find(BlurredModal).prop('size')).toEqual(modalSize);
expect(wrapper.find(Modal).prop('size')).toEqual(modalSize);
});
it.each([