mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 15:56:56 +02:00
Allow network, genus, taxon, species lookups to expect uppercase values
(closes #3377) In most cases we prefer taginfo value results with lowercase letters. A few OSM keys expect values to contain uppercase values This is not an exhaustive list (e.g. `name` also has uppercase values) but these are the fields where taginfo value lookup is most useful.
This commit is contained in:
@@ -195,6 +195,42 @@ describe('iD.serviceTaginfo', function() {
|
||||
{'value':'US:MD','title':'State highways in the U.S. state of Maryland.'}
|
||||
]);
|
||||
});
|
||||
|
||||
it('includes biological genus values with capital letters', function() {
|
||||
var callback = sinon.spy();
|
||||
taginfo.values({key: 'genus', query: 'qu'}, callback);
|
||||
|
||||
server.respondWith('GET', new RegExp('https://taginfo.openstreetmap.org/api/4/key/values'),
|
||||
[200, { 'Content-Type': 'application/json' },
|
||||
'{"data":[{"value":"Quercus","description":"Oak", "fraction":0.5}]}']);
|
||||
server.respond();
|
||||
|
||||
expect(callback).to.have.been.calledWith(null, [{'value':'Quercus','title':'Oak'}]);
|
||||
});
|
||||
|
||||
it('includes biological taxon values with capital letters', function() {
|
||||
var callback = sinon.spy();
|
||||
taginfo.values({key: 'taxon', query: 'qu'}, callback);
|
||||
|
||||
server.respondWith('GET', new RegExp('https://taginfo.openstreetmap.org/api/4/key/values'),
|
||||
[200, { 'Content-Type': 'application/json' },
|
||||
'{"data":[{"value":"Quercus robur","description":"Oak", "fraction":0.5}]}']);
|
||||
server.respond();
|
||||
|
||||
expect(callback).to.have.been.calledWith(null, [{'value':'Quercus robur','title':'Oak'}]);
|
||||
});
|
||||
|
||||
it('includes biological species values with capital letters', function() {
|
||||
var callback = sinon.spy();
|
||||
taginfo.values({key: 'species', query: 'qu'}, callback);
|
||||
|
||||
server.respondWith('GET', new RegExp('https://taginfo.openstreetmap.org/api/4/key/values'),
|
||||
[200, { 'Content-Type': 'application/json' },
|
||||
'{"data":[{"value":"Quercus robur","description":"Oak", "fraction":0.5}]}']);
|
||||
server.respond();
|
||||
|
||||
expect(callback).to.have.been.calledWith(null, [{'value':'Quercus robur','title':'Oak'}]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#roles', function() {
|
||||
|
||||
Reference in New Issue
Block a user