fix collection tree test breakage

Save the child collection after removing its parent in toJSON() collectionTest.
Otherwise, getDescendents throws an error if the parent collection
tries to access the deleted child in later tests.
This commit is contained in:
abaevbog 2024-01-09 23:41:32 -05:00 committed by Dan Stillman
parent d44b869420
commit 1e793a37a8

View file

@ -332,6 +332,7 @@ describe("Zotero.Collection", function() {
var patchBase = col2.toJSON(); var patchBase = col2.toJSON();
// Clear parent collection and regenerate JSON // Clear parent collection and regenerate JSON
col2.parentID = false; col2.parentID = false;
yield col2.saveTx();
var json = col2.toJSON({ patchBase }); var json = col2.toJSON({ patchBase });
assert.isFalse(json.parentCollection); assert.isFalse(json.parentCollection);
}); });