From 9fbd84b27eac7e34bf587c2649ed166d85a7ec01 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 9 Dec 2016 01:18:03 -0500 Subject: [PATCH] Move ItemGetter test to correct section --- test/tests/translateTest.js | 48 ++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/test/tests/translateTest.js b/test/tests/translateTest.js index ac83a8d36b..207f33a053 100644 --- a/test/tests/translateTest.js +++ b/test/tests/translateTest.js @@ -596,31 +596,6 @@ describe("Zotero.Translate", function() { Zotero.Translators.get.restore(); }); }); - - describe("ItemSaver", function () { - describe("#saveItems()", function () { - it("should handle missing attachment files", function* () { - var item = yield importFileAttachment('test.png'); - var path = item.getFilePath(); - // Delete attachment file - yield OS.File.remove(path); - - var translation = new Zotero.Translate.Export(); - var tmpDir = yield getTempDirectory(); - var exportDir = OS.Path.join(tmpDir, 'export'); - translation.setLocation(Zotero.File.pathToFile(exportDir)); - translation.setItems([item]); - translation.setTranslator('14763d24-8ba0-45df-8f52-b8d1108e7ac9'); // Zotero RDF - translation.setDisplayOptions({ - exportFileData: true - }); - yield translation.translate(); - - var exportFile = OS.Path.join(exportDir, 'export.rdf'); - assert.isAbove((yield OS.File.stat(exportFile)).size, 0); - }); - }); - }); }); describe("Zotero.Translate.ItemGetter", function() { @@ -1223,5 +1198,28 @@ describe("Zotero.Translate.ItemGetter", function() { assert.equal(getter.numItems, 2); }); }); + + describe("#_attachmentToArray()", function () { + it("should handle missing attachment files", function* () { + var item = yield importFileAttachment('test.png'); + var path = item.getFilePath(); + // Delete attachment file + yield OS.File.remove(path); + + var translation = new Zotero.Translate.Export(); + var tmpDir = yield getTempDirectory(); + var exportDir = OS.Path.join(tmpDir, 'export'); + translation.setLocation(Zotero.File.pathToFile(exportDir)); + translation.setItems([item]); + translation.setTranslator('14763d24-8ba0-45df-8f52-b8d1108e7ac9'); // Zotero RDF + translation.setDisplayOptions({ + exportFileData: true + }); + yield translation.translate(); + + var exportFile = OS.Path.join(exportDir, 'export.rdf'); + assert.isAbove((yield OS.File.stat(exportFile)).size, 0); + }); + }); }); } \ No newline at end of file