From 82857dd160d3ae390b82cad39e74acc5da3ba22a Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Sat, 3 Nov 2018 12:36:25 +0100 Subject: [PATCH 1/2] tag values with wiki page may be documented as bad fixes #5460 --- modules/services/taginfo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/taginfo.js b/modules/services/taginfo.js index 6242be845..524f833d3 100644 --- a/modules/services/taginfo.js +++ b/modules/services/taginfo.js @@ -90,7 +90,7 @@ function filterValues(allowUpperCase) { return function(d) { if (d.value.match(/[;,]/) !== null) return false; // exclude some punctuation if (!allowUpperCase && d.value.match(/[A-Z*]/) !== null) return false; // exclude uppercase letters - return parseFloat(d.fraction) > 0.0 || d.in_wiki; + return parseFloat(d.fraction) > 0.0; }; } From e285066032a5a580f45bf176c483f90e6a9a449a Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Sat, 3 Nov 2018 13:28:54 +0100 Subject: [PATCH 2/2] invert tests for inverted behavior --- test/spec/services/taginfo.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/spec/services/taginfo.js b/test/spec/services/taginfo.js index 146e748ad..20c78e661 100644 --- a/test/spec/services/taginfo.js +++ b/test/spec/services/taginfo.js @@ -85,7 +85,7 @@ describe('iD.serviceTaginfo', function() { ); }); - it('includes unpopular keys with a wiki page', function() { + it('does not include unpopular keys with a wiki page', function() { var callback = sinon.spy(); taginfo.keys({query: 'amen'}, callback); @@ -96,10 +96,7 @@ describe('iD.serviceTaginfo', function() { ); server.respond(); - expect(callback).to.have.been.calledWith(null, [ - {'title':'amenity', 'value':'amenity'}, - {'title':'amenityother', 'value':'amenityother'} - ]); + expect(callback).to.have.been.calledWith(null, [{'title':'amenity', 'value':'amenity'}]); }); it('sorts keys with \':\' below keys without \':\'', function() { @@ -220,7 +217,7 @@ describe('iD.serviceTaginfo', function() { expect(callback).to.have.been.calledWith(null, []); }); - it('includes unpopular values with a wiki page', function() { + it('does not include unpopular values with a wiki page', function() { var callback = sinon.spy(); taginfo.values({key: 'amenity', query: 'par'}, callback); @@ -233,7 +230,6 @@ describe('iD.serviceTaginfo', function() { expect(callback).to.have.been.calledWith(null, [ {'value':'parking','title':'A place for parking cars'}, - {'value':'party','title':'A place for partying'} ]); });