From 35d4bc67c1f824ddfdc06ed3aafd45460a44623e Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 29 Jul 2020 05:52:41 -0700 Subject: [PATCH] allow others to update `URL.revokeObjectURL` property if needed (#73639) Co-authored-by: spalger Co-authored-by: Elastic Machine --- .../public/panel_actions/get_csv_panel_action.test.ts | 6 +++++- .../value_lists_management_modal/auto_download.test.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.test.ts b/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.test.ts index 105c5cd109533..f07235742a1d3 100644 --- a/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.test.ts +++ b/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.test.ts @@ -18,7 +18,11 @@ describe('GetCsvReportPanelAction', () => { beforeAll(() => { if (typeof window.URL.revokeObjectURL === 'undefined') { - Object.defineProperty(window.URL, 'revokeObjectURL', { value: () => {} }); + Object.defineProperty(window.URL, 'revokeObjectURL', { + configurable: true, + writable: true, + value: () => {}, + }); } }); diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/auto_download.test.tsx b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/auto_download.test.tsx index 53dcf986d395c..be84c37d40606 100644 --- a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/auto_download.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/value_lists_management_modal/auto_download.test.tsx @@ -12,8 +12,8 @@ import { AutoDownload } from './auto_download'; describe('AutoDownload', () => { beforeEach(() => { - // our DOM environment lacks this function that our component needs Object.defineProperty(globalNode.window.URL, 'revokeObjectURL', { + configurable: true, writable: true, value: jest.fn(), });