diff --git a/packages/dnb-eufemia/src/components/upload/__tests__/UploadFileListCell.test.tsx b/packages/dnb-eufemia/src/components/upload/__tests__/UploadFileListCell.test.tsx index 73ac3a5d633..260e03fd905 100644 --- a/packages/dnb-eufemia/src/components/upload/__tests__/UploadFileListCell.test.tsx +++ b/packages/dnb-eufemia/src/components/upload/__tests__/UploadFileListCell.test.tsx @@ -223,6 +223,7 @@ describe('UploadFileListCell', () => { const fileName = 'file.png' const mockUrl = 'mock-url' + const originalCreateObjectURL = global.URL.createObjectURL global.URL.createObjectURL = jest.fn().mockReturnValueOnce(mockUrl) render( @@ -237,6 +238,8 @@ describe('UploadFileListCell', () => { fileName ) as HTMLAnchorElement expect(anchorElement.href).toMatch(mockUrl) + + global.URL.createObjectURL = originalCreateObjectURL }) it('renders the download attribute', () => { diff --git a/packages/dnb-eufemia/src/extensions/forms/Value/Upload/__tests__/Upload.test.tsx b/packages/dnb-eufemia/src/extensions/forms/Value/Upload/__tests__/Upload.test.tsx index 00979aa7b22..6464ae6536f 100644 --- a/packages/dnb-eufemia/src/extensions/forms/Value/Upload/__tests__/Upload.test.tsx +++ b/packages/dnb-eufemia/src/extensions/forms/Value/Upload/__tests__/Upload.test.tsx @@ -415,6 +415,7 @@ describe('Value.Upload', () => { const fileName = 'file.png' const mockUrl = 'mock-url' + const originalCreateObjectURL = global.URL.createObjectURL global.URL.createObjectURL = jest.fn().mockReturnValueOnce(mockUrl) render( @@ -432,6 +433,8 @@ describe('Value.Upload', () => { fileName ) as HTMLAnchorElement expect(anchorElement.href).toMatch(mockUrl) + + global.URL.createObjectURL = originalCreateObjectURL }) it('renders the download attribute', () => {