Fix collection saving
This commit is contained in:
parent
694896273a
commit
99dfc72a18
|
@ -296,7 +296,6 @@ Zotero.Collection.prototype._saveData = Zotero.Promise.coroutine(function* (env)
|
|||
'collectionID',
|
||||
'collectionName',
|
||||
'parentCollectionID',
|
||||
'clientDateModified',
|
||||
'libraryID',
|
||||
'key',
|
||||
'version',
|
||||
|
@ -306,7 +305,6 @@ Zotero.Collection.prototype._saveData = Zotero.Promise.coroutine(function* (env)
|
|||
collectionID ? { int: collectionID } : null,
|
||||
{ string: this.name },
|
||||
env.parent ? env.parent : null,
|
||||
Zotero.DB.transactionDateTime,
|
||||
this.libraryID,
|
||||
key,
|
||||
this.version ? this.version : 0,
|
||||
|
|
13
test/tests/collectionTest.js
Normal file
13
test/tests/collectionTest.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
describe("Zotero.Collection", function() {
|
||||
describe("#save()", function () {
|
||||
it("should save a new collection", function* () {
|
||||
var name = "Test";
|
||||
|
||||
var collection = new Zotero.Collection;
|
||||
collection.name = name;
|
||||
var id = yield collection.save();
|
||||
collection = yield Zotero.Collections.getAsync(id);
|
||||
assert.equal(collection.name, name);
|
||||
});
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue
Block a user