From 77ea19277d9e1f0ff92b4f5151f809c1f458a9e4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 19 Feb 2021 06:39:30 -0500 Subject: [PATCH] Remove embedded-image attachment under annotation in test --- chrome/content/zotero/xpcom/attachments.js | 2 +- test/tests/dataObjectsTest.js | 29 +++++++++++----------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index 53da821951..ccb3b6cd49 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -366,7 +366,7 @@ Zotero.Attachments = new function(){ * @return {Promise} */ 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"); diff --git a/test/tests/dataObjectsTest.js b/test/tests/dataObjectsTest.js index 90945c8b47..e5e0f06688 100644 --- a/test/tests/dataObjectsTest.js +++ b/test/tests/dataObjectsTest.js @@ -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); });