From bbb6434524e9b4e8604cad5eb4ffbcbe9fe718a5 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 7 Nov 2017 16:53:31 -0500 Subject: [PATCH] Add test for short DOI parsing Follow-up to #1356 --- test/tests/utilitiesTest.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/tests/utilitiesTest.js b/test/tests/utilitiesTest.js index d0e62605f..a12f665b4 100644 --- a/test/tests/utilitiesTest.js +++ b/test/tests/utilitiesTest.js @@ -37,11 +37,16 @@ describe("Zotero.Utilities", function() { describe("#cleanDOI()", function () { var cleanDOI = Zotero.Utilities.cleanDOI; var doi = '10.1088/1748-9326/11/4/048002'; + var shortDOI = '10/aabbe'; it("should parse a DOI", function () { assert.equal(cleanDOI(`${doi}`), doi); }); + it("should parse a short DOI", function () { + assert.equal(cleanDOI(`${shortDOI}`), shortDOI); + }); + it("should parse a DOI at the end of a sentence", function () { assert.equal(cleanDOI(`Foo bar ${doi}. Foo bar`), doi); });