Fix error handling during local file import translation

A failure during detect (which is normal during file import attempts)
would cause later translator detection to fail.
This commit is contained in:
Dan Stillman 2016-08-22 21:28:34 -04:00
parent 8aee80106d
commit bdec4b119f
5 changed files with 55 additions and 63 deletions

View file

@ -73,4 +73,17 @@ describe("Zotero_File_Interface", function() {
assert.lengthOf(matches, 1);
assert.propertyVal(matches[0], 'id', attachment.id);
});
it('should import a MODS file', function* () {
var modsFile = OS.Path.join(getTestDataDirectory().path, "mods.xml");
var promise = waitForItemEvent('add');
yield win.Zotero_File_Interface.importFile(Zotero.File.pathToFile(modsFile));
var ids = yield promise;
assert.lengthOf(ids, 1);
var item = Zotero.Items.get(ids[0]);
assert.equal(item.itemTypeID, Zotero.ItemTypes.getID('journalArticle'));
assert.equal(item.getField('title'), "Test");
});
});