From 73a826cefca2149ba631d6c45da58c7d9634487f Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Thu, 24 Sep 2020 08:30:19 -0400 Subject: [PATCH] Fix code tests for bbbf401232319c401e62e585c24d4ad4f8b8ce13 --- test/spec/services/osm_wikibase.js | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/test/spec/services/osm_wikibase.js b/test/spec/services/osm_wikibase.js index 58689647f..b56b24035 100644 --- a/test/spec/services/osm_wikibase.js +++ b/test/spec/services/osm_wikibase.js @@ -24,18 +24,8 @@ describe('iD.serviceOsmWikibase', function () { return iD.utilStringQs(url.substring(url.indexOf('?'))); } - function adjust(params, data) { - if (params) { - if (params.norm) { - data.description = data.descriptions.fr.value; - data.label = data.labels.fr.value; - } - } - return data; - } - - function keyData(params) { - return adjust(params, { + function keyData() { + return { pageid: 205725, ns: 120, title: 'Item:Q42', @@ -143,11 +133,11 @@ describe('iD.serviceOsmWikibase', function () { badges: [] } } - }); + }; } - function tagData(params) { - return adjust(params, { + function tagData() { + return { pageid: 210934, ns: 120, title: 'Item:Q13', @@ -263,7 +253,7 @@ describe('iD.serviceOsmWikibase', function () { badges: [] } } - }); + }; } @@ -275,7 +265,7 @@ describe('iD.serviceOsmWikibase', function () { describe('#getEntity', function () { it('calls the given callback with the results of the getEntity data item query', function (done) { var callback = sinon.spy(); - wikibase.getEntity({key: 'amenity', value: 'parking', langCode: 'fr'}, callback); + wikibase.getEntity({key: 'amenity', value: 'parking', langCodes: ['fr']}, callback); server.respondWith('GET', /action=wbgetentities/, [200, {'Content-Type': 'application/json'}, JSON.stringify({ @@ -302,8 +292,8 @@ describe('iD.serviceOsmWikibase', function () { } ); expect(callback).to.have.been.calledWith(null, { - key: keyData({norm: true}), - tag: tagData({norm: true}) + key: keyData(), + tag: tagData() }); done(); }, 50);