commit eb1aa43da21f91dc6472e4ea8c4ff0649f5d14af
parent 753252be77276bf8cba9fe63477ce21c298e3732
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 28 Sep 2016 11:45:18 -0400
Remove test for Extra field parsing after 30f7ef093
Diffstat:
1 file changed, 1 insertion(+), 41 deletions(-)
diff --git a/test/tests/utilitiesTest.js b/test/tests/utilitiesTest.js
@@ -235,47 +235,7 @@ describe("Zotero.Utilities", function() {
assert.throws(Zotero.Utilities.itemToCSLJSON.bind(Zotero.Utilities, exportFormat), /^Unexpected Zotero Item type ".*"$/, 'throws an error when trying to map invalid item types');
}));
- it("should map additional fields from Extra field", Zotero.Promise.coroutine(function* () {
- let item = new Zotero.Item('journalArticle');
- item.setField('extra', 'PMID: 12345\nPMCID:123456\nDOI:10.5064/F6PN93H4');
- yield item.saveTx();
-
- let cslJSON = Zotero.Utilities.itemToCSLJSON(item);
-
- assert.equal(cslJSON.PMID, '12345', 'PMID from Extra is mapped to PMID');
- assert.equal(cslJSON.PMCID, '123456', 'PMCID from Extra is mapped to PMCID');
- assert.equal(cslJSON.DOI, '10.5064/F6PN93H4', 'DOI from Extra field is mapped to DOI');
-
- item.setField('extra', 'PMID: 12345');
- yield item.saveTx();
- cslJSON = Zotero.Utilities.itemToCSLJSON(item);
-
- assert.equal(cslJSON.PMID, '12345', 'single-line entry is extracted correctly');
-
- item.setField('extra', 'some junk: note\nPMID: 12345\nstuff in-between\nPMCID: 123456\nDOI: 10.5064/F6PN93H4\nlast bit of junk!');
- yield item.saveTx();
- cslJSON = Zotero.Utilities.itemToCSLJSON(item);
-
- assert.equal(cslJSON.PMID, '12345', 'PMID from mixed Extra field is mapped to PMID');
- assert.equal(cslJSON.PMCID, '123456', 'PMCID from mixed Extra field is mapped to PMCID');
- assert.equal(cslJSON.DOI, '10.5064/F6PN93H4', 'DOI from mixed Extra field is mapped to DOI');
-
- item.setField('extra', 'a\n PMID: 12345\nfoo PMCID: 123456\n10.5064/F6PN93H4');
- yield item.saveTx();
- cslJSON = Zotero.Utilities.itemToCSLJSON(item);
-
- assert.isUndefined(cslJSON.PMCID, 'field label must not be preceded by other text');
- assert.isUndefined(cslJSON.PMID, 'field label must not be preceded by a space');
- assert.isUndefined(cslJSON.DOI, 'DOI must be preceded by label');
- assert.equal(cslJSON.note, 'a\n PMID: 12345\nfoo PMCID: 123456\n10.5064/F6PN93H4', 'note is left untouched if nothing is extracted');
-
-
- item.setField('extra', 'something\npmid: 12345\n');
- yield item.saveTx();
- cslJSON = Zotero.Utilities.itemToCSLJSON(item);
-
- assert.isUndefined(cslJSON.PMID, 'field labels are case-sensitive');
- }));
+
it("should parse particles in creator names", function* () {
let creators = [
{