Update empty state of parent collection when deleting subcollection

This commit is contained in:
Dan Stillman 2017-02-03 01:17:08 -05:00
parent a57ea28d42
commit 55e9a0ee35
2 changed files with 21 additions and 0 deletions

View file

@ -168,6 +168,17 @@ describe("Zotero.Collection", function() {
var childCollections = collection1.getChildCollections();
assert.lengthOf(childCollections, 0);
})
it("should not include collections that have been deleted", function* () {
var collection1 = yield createDataObject('collection');
var collection2 = yield createDataObject('collection', { parentID: collection1.id });
yield collection1.saveTx();
yield collection2.eraseTx()
var childCollections = collection1.getChildCollections();
assert.lengthOf(childCollections, 0);
})
})
describe("#getChildItems()", function () {