Remove embedded-image attachment under annotation in test

This commit is contained in:
Dan Stillman 2021-02-19 06:39:30 -05:00
parent 651aabc4dc
commit 77ea19277d
2 changed files with 15 additions and 16 deletions

View file

@ -366,7 +366,7 @@ Zotero.Attachments = new function(){
* @return {Promise<Zotero.Item>}
*/
this.importEmbeddedImage = async function ({ blob, parentItemID, saveOptions }) {
Zotero.debug('Importing note or annotation image');
Zotero.debug('Importing embedded image');
if (!parentItemID) {
throw new Error("parentItemID must be provided");

View file

@ -137,17 +137,17 @@ describe("Zotero.DataObjects", function () {
function check(arr) {
var str = arr.map(o => title(o)).join('');
var possibilities = [
'ACDEFHI',
'ACDEFIH',
'ACDEFH',
'ACDEFH',
'ADCEFHI',
'ADCEFIH',
'ADCEFH',
'ADCEFH',
'EFHIACD',
'EFHIADC',
'EFHACD',
'EFHADC',
'EFIHACD',
'EFIHADC',
'EFHACD',
'EFHADC',
];
assert.oneOf(str, possibilities);
}
@ -163,30 +163,29 @@ describe("Zotero.DataObjects", function () {
var e = await createDataObject('item', { title: "E" });
var f = await importPDFAttachment(e, { title: 'F' });
var g = await createAnnotation('image', f, { tags: [{ tag: 'G' }] });
var h = await createEmbeddedImage(g, { tags: [{ tag: 'H' }] });
var i = await createAnnotation('highlight', f, { tags: [{ tag: 'I' }] });
var h = await createAnnotation('highlight', f, { tags: [{ tag: 'H' }] });
var arr = Zotero.Items.sortByParent([a, c, d, e, f, h, i]);
var arr = Zotero.Items.sortByParent([a, c, d, e, f, h]);
Zotero.debug(arr.map(o => title(o)));
check(arr);
// Reverse order
arr = Zotero.Items.sortByParent([a, c, d, e, f, h, i].reverse());
arr = Zotero.Items.sortByParent([a, c, d, e, f, h].reverse());
Zotero.debug(arr.map(o => title(o)));
check(arr);
// Top-level first
arr = Zotero.Items.sortByParent([a, e, c, d, f, h, i]);
arr = Zotero.Items.sortByParent([a, e, c, d, f, h]);
Zotero.debug(arr.map(o => title(o)));
check(arr);
// Child first
arr = Zotero.Items.sortByParent([c, h, d, i, f, a, e]);
arr = Zotero.Items.sortByParent([c, h, d, f, a, e]);
Zotero.debug(arr.map(o => title(o)));
check(arr);
// Random
arr = Zotero.Items.sortByParent([i, e, d, h, c, a, f]);
arr = Zotero.Items.sortByParent([e, d, h, c, a, f]);
Zotero.debug(arr.map(o => title(o)));
check(arr);
});