aboutsummaryrefslogtreecommitdiff
path: root/webAO/services/__tests__/downloadFile.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/services/__tests__/downloadFile.test.ts')
-rw-r--r--webAO/services/__tests__/downloadFile.test.ts27
1 files changed, 0 insertions, 27 deletions
diff --git a/webAO/services/__tests__/downloadFile.test.ts b/webAO/services/__tests__/downloadFile.test.ts
deleted file mode 100644
index c37c735..0000000
--- a/webAO/services/__tests__/downloadFile.test.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import downloadFile from "../downloadFile";
-jest.useFakeTimers().setSystemTime(new Date("2020-01-01").getTime());
-
-global.URL.createObjectURL = jest.fn();
-(window as any).global.Blob = function (content, options) {
- return { content, options };
-};
-
-describe("downloadFile", () => {
- it("Creates an <a> tag", () => {
- const createElementSpy = jest.spyOn(document, "createElement");
- downloadFile("hi", "filename");
- expect(createElementSpy).toBeCalled();
- });
- it("Creates the blob with the correct data", () => {
- const data = "writingtestsishard";
- global.URL.createObjectURL = jest.fn(() => data);
- downloadFile(data, "filename");
- const expected = {
- content: [data],
- options: {
- type: "text",
- },
- };
- expect(global.URL.createObjectURL).toBeCalledWith(expected);
- });
-});