This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/services/datafile/datafile.service.impl.spec.ts
2017-03-11 17:45:36 -08:00

42 lines
No EOL
1 KiB
TypeScript

import { DataFileServiceImpl } from './datafile.service.impl';
import { Mock } from 'ts-mocks';
describe("DataFileServiceImpl", () => {
var dataFileServiceImpl: DataFileServiceImpl;
var fileReaderMock: Mock<FileReader>;
var fileReader: FileReader;
beforeEach(() => {
fileReaderMock = new Mock<FileReader>();
fileReader = fileReaderMock.Object;
dataFileServiceImpl = new DataFileServiceImpl(() => fileReader);
});
describe("blobToString", () => {
beforeEach(() => {
fileReaderMock.setup(mock => mock.readAsText).is((blob: Blob) => {
fileReaderMock.Object.onload(<any>{target: {result: blob.toString()}});
});
});
});
describe("arrayToString", () => {
beforeEach(() => {
fileReaderMock.setup(mock => mock.readAsArrayBuffer).is((blob: Blob) => {
fileReaderMock.Object.onload(<any>{target: {result: blob.toString()}});
});
});
});
describe("readDataArrayAsPossibleArchive", () => {
});
describe("downloadDataFileAsArrayBuffer", () => {
});
});