Add test for short DOI parsing

Follow-up to #1356
This commit is contained in:
Dan Stillman 2017-11-07 16:53:31 -05:00
parent bb1cbdff26
commit bbb6434524

View File

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