Created ImageDownloader test

This commit is contained in:
Alejandro Celaya
2021-09-19 10:57:36 +02:00
parent 3a8c7a7bf4
commit 9518a5e442
7 changed files with 50 additions and 32 deletions

18
test/mocks/WindowMock.ts Normal file
View 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 },
},
});