Fix trashing of descendant items when deleting a collection

Also allows 'collections' property to be passed to
createDataObject()/createUnsavedDataObject() in tests.
This commit is contained in:
Dan Stillman 2016-01-17 16:55:34 -05:00
parent a80f130997
commit e873617890
9 changed files with 72 additions and 32 deletions

View file

@ -319,6 +319,9 @@ function createUnsavedDataObject(objectType, params = {}) {
if (params.title !== undefined || params.setTitle) {
obj.setField('title', params.title !== undefined ? params.title : Zotero.Utilities.randomString());
}
if (params.collections !== undefined) {
obj.setCollections(params.collections);
}
break;
case 'collection':