commit 42968949b658d5c94cf0ab31ff3327ac10d16d22
parent e8bffc22752470012f82745e0fabdddb44462416
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 21 Mar 2016 18:11:30 -0400
Fix collection export
Closes #734, maybe?
Diffstat:
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/translation/translate_item.js b/chrome/content/zotero/xpcom/translation/translate_item.js
@@ -672,7 +672,7 @@ Zotero.Translate.ItemGetter.prototype = {
}
}
- this._itemsLeft = Array.from(items.values);
+ this._itemsLeft = Array.from(items.values());
this.numItems = this._itemsLeft.length;
}),
diff --git a/test/tests/translateTest.js b/test/tests/translateTest.js
@@ -1156,5 +1156,19 @@ describe("Zotero.Translate.ItemGetter", function() {
}
}));
});
+
+ describe("#setCollection()", function () {
+ it("should add collection items", function* () {
+ var col = yield createDataObject('collection');
+ var item1 = yield createDataObject('item', { collections: [col.id] });
+ var item2 = yield createDataObject('item', { collections: [col.id] });
+ var item3 = yield createDataObject('item');
+
+ let getter = new Zotero.Translate.ItemGetter();
+ getter.setCollection(col);
+
+ assert.equal(getter.numItems, 2);
+ });
+ });
});
}
\ No newline at end of file