Asyncify Zotero.Attachments.getTotalFileSize()

This commit is contained in:
Dan Stillman 2015-08-09 04:52:14 -04:00
parent 2df630e83c
commit fc1137b769
2 changed files with 40 additions and 22 deletions

View file

@ -111,4 +111,18 @@ describe("Zotero.Attachments", function() {
// Should create a group library for use by all tests
})
})
describe("#getTotalFileSize", function () {
it("should return the size for a single-file attachment", function* () {
var file = getTestDataDirectory();
file.append('test.png');
// Create attachment and compare content
var item = yield Zotero.Attachments.importFromFile({
file: file
});
assert.equal((yield Zotero.Attachments.getTotalFileSize(item)), file.fileSize);
})
})
})