Fix error deleting collection after emptying trash

Follow-up to c442daedce
Fixes #1317
This commit is contained in:
Dan Stillman 2017-09-18 17:03:12 -04:00
parent 49506b6d94
commit afc7afeb9c
2 changed files with 8 additions and 2 deletions

View file

@ -251,7 +251,13 @@ describe("Zotero.Collection", function() {
var item = yield createDataObject('item', { collections: [ col.id ] });
assert.lengthOf(col.getChildItems(), 1);
yield item.erase();
Zotero.debug(col.getChildItems());
assert.lengthOf(col.getChildItems(), 0);
});
it("should not include items emptied from trash", function* () {
var col = yield createDataObject('collection');
var item = yield createDataObject('item', { collections: [ col.id ], deleted: true });
yield item.erase();
assert.lengthOf(col.getChildItems(), 0);
});
})