Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker authored and langz committed Dec 13, 2024
1 parent f601547 commit 68d4944
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -237,6 +238,8 @@ describe('UploadFileListCell', () => {
fileName
) as HTMLAnchorElement
expect(anchorElement.href).toMatch(mockUrl)

global.URL.createObjectURL = originalCreateObjectURL
})

it('renders the download attribute', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -432,6 +433,8 @@ describe('Value.Upload', () => {
fileName
) as HTMLAnchorElement
expect(anchorElement.href).toMatch(mockUrl)

global.URL.createObjectURL = originalCreateObjectURL
})

it('renders the download attribute', () => {
Expand Down

0 comments on commit 68d4944

Please sign in to comment.