From 1e793a37a87e98f29dbb61dfa5b5ca863eb53646 Mon Sep 17 00:00:00 2001 From: abaevbog Date: Tue, 9 Jan 2024 23:41:32 -0500 Subject: [PATCH] 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. --- test/tests/collectionTest.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/tests/collectionTest.js b/test/tests/collectionTest.js index a9b19869f1..c19dede231 100644 --- a/test/tests/collectionTest.js +++ b/test/tests/collectionTest.js @@ -332,6 +332,7 @@ describe("Zotero.Collection", function() { var patchBase = col2.toJSON(); // Clear parent collection and regenerate JSON col2.parentID = false; + yield col2.saveTx(); var json = col2.toJSON({ patchBase }); assert.isFalse(json.parentCollection); });