Move ItemGetter test to correct section

This commit is contained in:
Dan Stillman 2016-12-09 01:18:03 -05:00
parent 0e72ee3305
commit 9fbd84b27e

View file

@ -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);
});
});
});
}