Asyncify Zotero.Attachments.getTotalFileSize()
This commit is contained in:
parent
2df630e83c
commit
fc1137b769
2 changed files with 40 additions and 22 deletions
|
@ -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);
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue