www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 8f39e9cb367dae156e74083a28e581594ca5ffe8
parent 1ef2469b406b9beebd89f5b0e187671e277068b8
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri,  4 May 2018 01:16:04 -0400

Rename PDF recognizer tests to reflect arXiv ID lookup

Addresses #1494 and #1495

Diffstat:
Rtest/tests/data/recognizePDF_test_DOI.pdf -> test/tests/data/recognizePDF_test_arXiv.pdf | 0
Mtest/tests/recognizePDFTest.js | 29+++++++++++++++++------------
2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/test/tests/data/recognizePDF_test_DOI.pdf b/test/tests/data/recognizePDF_test_arXiv.pdf Binary files differ. diff --git a/test/tests/recognizePDFTest.js b/test/tests/recognizePDFTest.js @@ -27,12 +27,14 @@ describe("PDF Recognition", function() { win.close(); } }); - - it("should recognize a PDF by DOI", async function () { + + it.skip("should recognize a PDF by DOI"); + + it("should recognize a PDF by arXiv ID", async function () { this.timeout(30000); // Import the PDF var testdir = getTestDataDirectory(); - testdir.append("recognizePDF_test_DOI.pdf"); + testdir.append("recognizePDF_test_arXiv.pdf"); var attachment = await Zotero.Attachments.importFromFile({ file: testdir }); @@ -42,10 +44,11 @@ describe("PDF Recognition", function() { var addedIDs = await waitForItemEvent("add"); var modifiedIDs = await waitForItemEvent("modify"); - assert.lengthOf(addedIDs, 1); + // Item and note + assert.lengthOf(addedIDs, 2); var item = Zotero.Items.get(addedIDs[0]); assert.equal(item.getField("title"), "Scaling study of an improved fermion action on quenched lattices"); - assert.lengthOf(modifiedIDs, 2); + assert.lengthOf(modifiedIDs, 1); // Wait for status to show as complete var progressWindow = getWindows("chrome://zotero/content/recognizePDFDialog.xul")[0]; @@ -65,7 +68,7 @@ describe("PDF Recognition", function() { this.timeout(30000); // Import the PDF var testdir = getTestDataDirectory(); - testdir.append("recognizePDF_test_DOI.pdf"); + testdir.append("recognizePDF_test_arXiv.pdf"); var collection = await createDataObject('collection'); var attachment = await Zotero.Attachments.importFromFile({ file: testdir, @@ -76,9 +79,10 @@ describe("PDF Recognition", function() { var addedIDs = await waitForItemEvent("add"); var modifiedIDs = await waitForItemEvent("modify"); - assert.lengthOf(addedIDs, 1); + // Item and note + assert.lengthOf(addedIDs, 2); var item = Zotero.Items.get(addedIDs[0]); - assert.lengthOf(modifiedIDs, 2); + assert.lengthOf(modifiedIDs, 1); // Wait for status to show as complete var progressWindow = getWindows("chrome://zotero/content/recognizePDFDialog.xul")[0]; @@ -90,10 +94,10 @@ describe("PDF Recognition", function() { assert.isTrue(collection.hasItem(item.id)); }); - it("should recognize PDF by DOI and put new item in same collection in group library", async function () { + it("should recognize PDF by arXiv ID and put new item in same collection in group library", async function () { this.timeout(30000); var testdir = getTestDataDirectory(); - testdir.append("recognizePDF_test_DOI.pdf"); + testdir.append("recognizePDF_test_arXiv.pdf"); var group = await getGroup(); var collection = await createDataObject('collection', { libraryID: group.libraryID }); var attachment = await Zotero.Attachments.importFromFile({ @@ -106,9 +110,10 @@ describe("PDF Recognition", function() { var addedIDs = await waitForItemEvent("add"); var modifiedIDs = await waitForItemEvent("modify"); - assert.lengthOf(addedIDs, 1); + // Item and note + assert.lengthOf(addedIDs, 2); var item = Zotero.Items.get(addedIDs[0]); - assert.lengthOf(modifiedIDs, 2); + assert.lengthOf(modifiedIDs, 1); // Wait for status to show as complete var progressWindow = getWindows("chrome://zotero/content/recognizePDFDialog.xul")[0];