diff --git a/lib/DocumentFilter/DocumentFilterField.test.js b/lib/DocumentFilter/DocumentFilterField.test.js index 5de4873f..f92177e2 100644 --- a/lib/DocumentFilter/DocumentFilterField.test.js +++ b/lib/DocumentFilter/DocumentFilterField.test.js @@ -1,7 +1,7 @@ import { MemoryRouter } from 'react-router-dom'; import { FieldArray } from 'react-final-form-arrays'; -import { screen, waitFor } from '@folio/jest-config-stripes/testing-library/react'; +import { waitFor } from '@folio/jest-config-stripes/testing-library/react'; import { renderWithIntl, TestForm, Button } from '@folio/stripes-erm-testing'; import { translationsProperties } from '../../test/jest/helpers'; diff --git a/lib/DocumentFilter/DocumentFilterForm.test.js b/lib/DocumentFilter/DocumentFilterForm.test.js index adaf0d0d..927c5472 100644 --- a/lib/DocumentFilter/DocumentFilterForm.test.js +++ b/lib/DocumentFilter/DocumentFilterForm.test.js @@ -195,4 +195,4 @@ describe('DocumentFilterForm', () => { }); }); }); -}); \ No newline at end of file +}); diff --git a/lib/utils/downloadBlob.js b/lib/utils/downloadBlob.js index a9e0638b..4ec99939 100644 --- a/lib/utils/downloadBlob.js +++ b/lib/utils/downloadBlob.js @@ -28,13 +28,12 @@ const downloadBlob = ( } return blob => { - const url = window.URL.createObjectURL(blob); + const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = downloadName; - document.body.appendChild(a); - a.click(); - a.remove(); + a.dispatchEvent(new MouseEvent('click', { bubbles: true })); + URL.revokeObjectURL(url); }; };