commit 99dfc72a18863de7a0b417e0a1ee3b664a6d5b87
parent 694896273ab65dd880ba1a8353365b4acdd48cb0
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 26 Apr 2015 02:44:29 -0400
Fix collection saving
Diffstat:
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/collection.js b/chrome/content/zotero/xpcom/data/collection.js
@@ -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,
diff --git a/test/tests/collectionTest.js b/test/tests/collectionTest.js
@@ -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);
+ });
+ })
+})