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:
parent
d44b869420
commit
1e793a37a8
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue