commit f12ae67c47d7a8e407f8ad8b7371ee8a657cf83c
parent 7e95f8fc51d4d62580496baf946fb10298cf5938
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 14 May 2017 05:26:10 -0400
Test for e1986b460e (export with empty attachment path)
Diffstat:
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/test/tests/translateTest.js b/test/tests/translateTest.js
@@ -1543,6 +1543,26 @@ describe("Zotero.Translate.ItemGetter", function() {
var exportFile = OS.Path.join(exportDir, 'export.rdf');
assert.isAbove((yield OS.File.stat(exportFile)).size, 0);
});
+
+ it("should handle empty attachment path", function* () {
+ var item = yield importFileAttachment('test.png');
+ item._attachmentPath = '';
+ assert.equal(item.attachmentPath, '');
+
+ 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