mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-12 10:33:49 +00:00
Created ImageDownloader test
This commit is contained in:
18
test/mocks/WindowMock.ts
Normal file
18
test/mocks/WindowMock.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Mock } from 'ts-mockery';
|
||||
|
||||
const createLinkMock = () => ({
|
||||
setAttribute: jest.fn(),
|
||||
click: jest.fn(),
|
||||
style: {},
|
||||
});
|
||||
|
||||
export const appendChild = jest.fn();
|
||||
|
||||
export const removeChild = jest.fn();
|
||||
|
||||
export const windowMock = Mock.of<Window>({
|
||||
document: {
|
||||
createElement: jest.fn(createLinkMock),
|
||||
body: { appendChild, removeChild },
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user