mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 17:40:23 +03:00
19 lines
362 B
TypeScript
19 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 },
|
||
|
},
|
||
|
});
|