From a43f9d16ac0279034c80c1c4a65b5d6e3b38417d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 23 Jan 2017 08:58:16 -0500 Subject: [PATCH] Allow number or name for translator type in buildDummyTranslator() This reverts c6b78da69d6, which changed it to expect numbers when I noticed the type being undefined in debug output, but apparently the only tests where the type actually mattered passed it as a name. At some point we should just change all tests to pass as a name. --- test/content/support.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/content/support.js b/test/content/support.js index 7e7315262..4e61d7fe5 100644 --- a/test/content/support.js +++ b/test/content/support.js @@ -776,10 +776,10 @@ var generateTranslatorExportData = Zotero.Promise.coroutine(function* generateTr * Build a dummy translator that can be passed to Zotero.Translate */ function buildDummyTranslator(translatorType, code, info={}) { - const TRANSLATOR_TYPES = {1: "import", 2: "export", 4: "web", 8: "search"}; + const TRANSLATOR_TYPES = {"import":1, "export":2, "web":4, "search":8}; info = Object.assign({ "translatorID":"dummy-translator", - "translatorType":TRANSLATOR_TYPES[translatorType], + "translatorType": Number.isInteger(translatorType) ? translatorType : TRANSLATOR_TYPES[translatorType], "label":"Dummy Translator", "creator":"Simon Kornblith", "target":"",