Skip to content

Commit f0f089b

Browse files
committed
More explicit setting of global DOM function
Our component fails due to this method being undefined, so we mock it out for these tests. We do not need to reset the mock as it is assigned fresh on every test.
1 parent 4191176 commit f0f089b

File tree

1 file changed

+1
-4
lines changed
  • x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal

1 file changed

+1
-4
lines changed

x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/auto_download.test.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ import { AutoDownload } from './auto_download';
1111

1212
describe('AutoDownload', () => {
1313
beforeEach(() => {
14+
// our DOM environment lacks this function that our component needs
1415
window.URL.revokeObjectURL = jest.fn();
1516
});
1617

17-
afterEach(() => {
18-
(window.URL.revokeObjectURL as jest.Mock).mockReset();
19-
});
20-
2118
it('calls onDownload once if a blob is provided', () => {
2219
const onDownload = jest.fn();
2320
mount(<AutoDownload blob={new Blob([''])} onDownload={onDownload} />);

0 commit comments

Comments
 (0)