From 2235592308106d8dac803d38ae8a0ac8248a10c5 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 30 Mar 2020 20:50:31 +0200 Subject: [PATCH] Fixed ShortUrlsRowMenu test --- test/short-urls/helpers/ShortUrlsRowMenu.test.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/short-urls/helpers/ShortUrlsRowMenu.test.js b/test/short-urls/helpers/ShortUrlsRowMenu.test.js index 8ffd0d38..853b2d9c 100644 --- a/test/short-urls/helpers/ShortUrlsRowMenu.test.js +++ b/test/short-urls/helpers/ShortUrlsRowMenu.test.js @@ -10,6 +10,7 @@ describe('', () => { const DeleteShortUrlModal = () => ''; const EditTagsModal = () => ''; const EditMetaModal = () => ''; + const EditShortUrlModal = () => ''; const onCopyToClipboard = jest.fn(); const selectedServer = { id: 'abc123' }; const shortUrl = { @@ -17,7 +18,13 @@ describe('', () => { shortUrl: 'https://doma.in/abc123', }; const createWrapper = () => { - const ShortUrlsRowMenu = createShortUrlsRowMenu(DeleteShortUrlModal, EditTagsModal, EditMetaModal, () => ''); + const ShortUrlsRowMenu = createShortUrlsRowMenu( + DeleteShortUrlModal, + EditTagsModal, + EditMetaModal, + EditShortUrlModal, + () => '' + ); wrapper = shallow( ', () => { const editTagsModal = wrapper.find(EditTagsModal); const previewModal = wrapper.find(PreviewModal); const qrCodeModal = wrapper.find(QrCodeModal); + const editModal = wrapper.find(EditShortUrlModal); expect(deleteShortUrlModal).toHaveLength(1); expect(editTagsModal).toHaveLength(1); expect(previewModal).toHaveLength(1); expect(qrCodeModal).toHaveLength(1); + expect(editModal).toHaveLength(1); }); it('renders correct amount of menu items', () => { const wrapper = createWrapper(); const items = wrapper.find(DropdownItem); - expect(items).toHaveLength(7); + expect(items).toHaveLength(8); expect(items.find('[divider]')).toHaveLength(1); }); @@ -70,6 +79,7 @@ describe('', () => { it('EditTagsModal', (done) => assert(EditTagsModal, 'isTagsModalOpen', done)); it('PreviewModal', (done) => assert(PreviewModal, 'isPreviewModalOpen', done)); it('QrCodeModal', (done) => assert(QrCodeModal, 'isQrModalOpen', done)); + it('EditShortUrlModal', (done) => assert(EditShortUrlModal, 'isEditModalOpen', done)); }); it('toggles dropdown state when toggling dropdown', (done) => {