Fix image annotation test after Item.annotationImageURL removal

This commit is contained in:
Dan Stillman 2020-12-18 09:00:18 -05:00
parent d44ab7efbb
commit f425b8d8d9

View file

@ -1266,8 +1266,9 @@ describe("Zotero.Item", function () {
});
await annotation.saveTx();
var blob = new Blob([array], { type: 'image/png' });
await Zotero.Attachments.importEmbeddedImage({
blob: new Blob([array], { type: 'image/png' }),
blob,
parentItemID: annotation.id
});
@ -1283,9 +1284,17 @@ describe("Zotero.Item", function () {
);
assert.equal(imageAttachment.attachmentContentType, 'image/png');
var blob2 = await new Zotero.Promise((resolve) => {
var reader = new FileReader();
reader.addEventListener("load", function () {
resolve(reader.result);
}, false);
reader.readAsDataURL(blob);
});
assert.equal(
annotation.annotationImageURL,
`zotero://attachment/library/items/${imageAttachment.key}`
await imageAttachment.attachmentDataURI,
blob2
);
});
});