shlink-web-client/test/__mocks__/Window.mock.ts
2022-07-16 10:52:45 +02:00

18 lines
362 B
TypeScript

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 },
},
});