mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-24 01:48:18 +03:00
19 lines
397 B
TypeScript
19 lines
397 B
TypeScript
|
import { fromAny, fromPartial } from '@total-typescript/shoehorn';
|
||
|
|
||
|
const createLinkMock = () => ({
|
||
|
setAttribute: vi.fn(),
|
||
|
click: vi.fn(),
|
||
|
style: {},
|
||
|
});
|
||
|
|
||
|
export const appendChild = vi.fn();
|
||
|
|
||
|
export const removeChild = vi.fn();
|
||
|
|
||
|
export const windowMock = fromPartial<Window>({
|
||
|
document: fromAny({
|
||
|
createElement: vi.fn(createLinkMock),
|
||
|
body: { appendChild, removeChild },
|
||
|
}),
|
||
|
});
|