mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-16 12:33:48 +00:00
Created ImageDownloader test
This commit is contained in:
@@ -2,19 +2,9 @@ import { Mock } from 'ts-mockery';
|
||||
import { CsvJson } from 'csvjson';
|
||||
import { VisitsExporter } from '../../../src/visits/services/VisitsExporter';
|
||||
import { NormalizedVisit } from '../../../src/visits/types';
|
||||
import { windowMock } from '../../mocks/WindowMock';
|
||||
|
||||
describe('VisitsExporter', () => {
|
||||
const createLinkMock = () => ({
|
||||
setAttribute: jest.fn(),
|
||||
click: jest.fn(),
|
||||
style: {},
|
||||
});
|
||||
const windowMock = Mock.of<Window>({
|
||||
document: {
|
||||
createElement: jest.fn(createLinkMock),
|
||||
body: { appendChild: jest.fn(), removeChild: jest.fn() },
|
||||
},
|
||||
});
|
||||
const toCSV = jest.fn();
|
||||
const csvToJsonMock = Mock.of<CsvJson>({ toCSV });
|
||||
let exporter: VisitsExporter;
|
||||
|
||||
Reference in New Issue
Block a user