Fix marking of childItems as loaded for non-top-level items

Now that attachments and notes can have child items too
This commit is contained in:
Dan Stillman 2020-12-27 19:49:50 -05:00
parent ea04c32c9d
commit b1e324ddfb
2 changed files with 20 additions and 3 deletions

View file

@ -624,4 +624,16 @@ describe("Zotero.Items", function () {
);
});
});
describe("#_loadChildItems()", function () {
it("should mark child items as loaded for an attachment", async function () {
var attachment = await importPDFAttachment();
var itemID = attachment.id;
Zotero.Items.unload([itemID]);
attachment = await Zotero.Items.getAsync(itemID);
await attachment.loadDataType('childItems');
assert.isTrue(attachment._loaded.childItems);
attachment.getAnnotations();
});
});
});