Test for e1986b460e
(export with empty attachment path)
This commit is contained in:
parent
7e95f8fc51
commit
f12ae67c47
|
@ -1543,6 +1543,26 @@ describe("Zotero.Translate.ItemGetter", function() {
|
||||||
var exportFile = OS.Path.join(exportDir, 'export.rdf');
|
var exportFile = OS.Path.join(exportDir, 'export.rdf');
|
||||||
assert.isAbove((yield OS.File.stat(exportFile)).size, 0);
|
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user