Mvolz has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/404984 )
Change subject: [WIP] Update tests
......................................................................
[WIP] Update tests
* Fixed title with upstream change in test/features/scraping/lang.js
* Formatting in test/features/scraping/zotero.js
TODO: fix pubmed conf test
Change-Id: I9e63b450e7cd4853537365aeefe5a748e1d20c93
---
M test/features/scraping/lang.js
M test/features/scraping/noPubmed.js
M test/features/scraping/zotero.js
3 files changed, 13 insertions(+), 14 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/citoid
refs/changes/84/404984/1
diff --git a/test/features/scraping/lang.js b/test/features/scraping/lang.js
index 8a42ae5..015580b 100644
--- a/test/features/scraping/lang.js
+++ b/test/features/scraping/lang.js
@@ -58,7 +58,7 @@
it('content-type header present in body but not in response headers',
function() {
return
server.query('https://www.insee.fr/fr/statistiques/zones/2021173').then(function(res)
{
assert.status(res, 200);
- assert.checkCitation(res, 'Populations légales 2013−Ces
données sont disponibles sur toutes les communes de France | Insee');
+ assert.checkCitation(res, 'Populations légales 2013 − Ces
données sont disponibles sur toutes les communes de France | Insee');
assert.deepEqual(!!res.body[0].accessDate, true, 'No
accessDate present');
});
});
diff --git a/test/features/scraping/noPubmed.js
b/test/features/scraping/noPubmed.js
index 18f6b96..97a0f70 100644
--- a/test/features/scraping/noPubmed.js
+++ b/test/features/scraping/noPubmed.js
@@ -11,7 +11,7 @@
after(() => server.stop());
}
-describe('Disable pubmed requests for extra IDs', function() {
+describe('noPubmed.js - Disable pubmed requests for extra IDs', function() {
this.timeout(20000);
@@ -251,7 +251,7 @@
});
-describe('Defaults conf to true if pubmed undefined', function() {
+describe.only('noPubmed.js - Defaults conf to true if pubmed undefined',
function() {
this.timeout(20000);
@@ -261,9 +261,9 @@
return server.query('10.1098/rspb.2000.1188').then(function(res) {
assert.status(res, 200);
assert.checkZotCitation(res, 'Moth hearing in response to bat
echolocation calls manipulated independently in time and frequency');
- assert.deepEqual(!!res.body[0].PMCID, true, 'Missing PMCID');
- assert.deepEqual(!!res.body[0].PMID, true, 'Missing PMID');
- assert.deepEqual(!!res.body[0].DOI, true, 'Missing DOI');
+ assert.deepEqual(!!res.body[0].PMCID, true, 'Missing PMCID'); //
Not present in Zotero - should come from API
+ assert.deepEqual(!!res.body[0].PMID, true, 'Missing PMID'); //
Present in Zotero
+ assert.deepEqual(!!res.body[0].DOI, true, 'Missing DOI'); //
Present in Zotero
assert.deepEqual(res.body[0].itemType, 'journalArticle', 'Wrong
itemType; expected journalArticle, got' + res.body[0].itemType);
});
});
diff --git a/test/features/scraping/zotero.js b/test/features/scraping/zotero.js
index b27ae5d..5b28c90 100644
--- a/test/features/scraping/zotero.js
+++ b/test/features/scraping/zotero.js
@@ -232,15 +232,14 @@
});
});
- });
- it('doi pointing to conferencePaper', function() {
- return server.query('10.1007/11926078_68').then(function(res) {
- assert.status(res, 200);
- assert.checkZotCitation(res, 'Semantic MediaWiki');
- assert.deepEqual(!!res.body[0].DOI, true, 'Missing DOI');
- assert.deepEqual(res.body[0].itemType, 'conferencePaper', 'Wrong
itemType; expected conferencePaper, got' + res.body[0].itemType);
-
+ it('doi pointing to conferencePaper', function() {
+ return server.query('10.1007/11926078_68').then(function(res) {
+ assert.status(res, 200);
+ assert.checkZotCitation(res, 'Semantic MediaWiki');
+ assert.deepEqual(!!res.body[0].DOI, true, 'Missing DOI');
+ assert.deepEqual(res.body[0].itemType, 'conferencePaper',
'Wrong itemType; expected conferencePaper, got' + res.body[0].itemType);
+ });
});
// Fake url but with info in cross ref that can be pulled from doi in
url - uses requestFromDOI & zotero
--
To view, visit https://gerrit.wikimedia.org/r/404984
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e63b450e7cd4853537365aeefe5a748e1d20c93
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/citoid
Gerrit-Branch: master
Gerrit-Owner: Mvolz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits