-
-
Notifications
You must be signed in to change notification settings - Fork 241
Expand file tree
/
Copy pathdownloader-spec.js
More file actions
23 lines (18 loc) · 744 Bytes
/
downloader-spec.js
File metadata and controls
23 lines (18 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
describe("Downloader", function() {
var url = Files.all[0];
it("creates a promise of the right type", function() {
var promise = Downloader.getFile(url);
expect(promise instanceof window.Promise).toBe(true);
});
it("tells the utils callback to download the files", function() {
spyOn(JSZipUtils, "getBinaryContent");
Downloader.getFile(url);
expect(JSZipUtils.getBinaryContent).toHaveBeenCalled();
});
it("calls the utils callback with the right url", function() {
spyOn(JSZipUtils, "getBinaryContent");
Downloader.getFile(url);
expect(JSZipUtils.getBinaryContent.calls.mostRecent().args).toContain(url);
expect(JSZipUtils.getBinaryContent.calls.mostRecent().args).toContain(url);
});
});