From f6ed98f255c9b8c52e25378fed22cf3095764f7f Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 23 Jun 2011 09:31:34 +0000 Subject: [PATCH] Also add tests to DOI translator --- translators/DOI.js | 58 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/translators/DOI.js b/translators/DOI.js index 110c30944..5db35e7fd 100644 --- a/translators/DOI.js +++ b/translators/DOI.js @@ -1,17 +1,3 @@ -{ - "translatorID":"c159dcfe-8a53-4301-a499-30f6549c340d", - "translatorType":4, - "label":"DOI", - "creator":"Simon Kornblith", - "target":null, - "minVersion":"1.0.10", - "maxVersion":"", - "priority":300, - "browserSupport":"gcs", - "inRepository":true, - "lastUpdated":"2011-06-23 08:58:22" -} - var items = {}; var selectArray = {}; @@ -109,3 +95,47 @@ function doWeb(doc, url) { Zotero.wait(); retrieveNextDOI(DOIs, doc); } + + +/** BEGIN TEST CASES **/ +var testCases = [ + { + "type": "web", + "url": "http://www.crossref.org/help/Content/01_About_DOIs/What_is_a_DOI.htm", + "items": [ + { + "itemType": "journalArticle", + "creators": [ + { + "creatorType": "author", + "firstName": "J", + "lastName": "Mou" + } + ], + "notes": [], + "tags": [], + "seeAlso": [], + "attachments": [ + { + "document": false + } + ], + "publicationTitle": "Journal of Molecular Biology", + "volume": "248", + "ISSN": "00222836", + "date": "1995-5-5", + "pages": "507-512", + "DOI": "10.1006/jmbi.1995.0238", + "url": "http://www.crossref.org/help/Content/01_About_DOIs/What_is_a_DOI.htm", + "title": "Atomic Force Microscopy of Cholera Toxin B-oligomers Bound to Bilayers of Biologically Relevant Lipids", + "libraryCatalog": "CrossRef" + } + ] + }, + { + "type": "web", + "url": "http://blog.apastyle.org/apastyle/digital-object-identifier-doi/", + "items": "multiple" + } +] +/** END TEST CASES **/ \ No newline at end of file