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

View File

@@ -2,21 +2,9 @@ import { Mock } from 'ts-mockery';
import { CsvJson } from 'csvjson';
import ServersExporter from '../../../src/servers/services/ServersExporter';
import LocalStorage from '../../../src/utils/services/LocalStorage';
import { appendChild, removeChild, windowMock } from '../../mocks/WindowMock';
describe('ServersExporter', () => {
const createLinkMock = () => ({
setAttribute: jest.fn(),
click: jest.fn(),
style: {},
});
const appendChild = jest.fn();
const removeChild = jest.fn();
const windowMock = Mock.of<Window>({
document: {
createElement: jest.fn(createLinkMock),
body: { appendChild, removeChild },
},
});
const storageMock = Mock.of<LocalStorage>({
get: jest.fn(() => ({
abc123: {