diff --git a/test/test.geocoder.js b/test/test.geocoder.js index 41df4afb..0090bb71 100644 --- a/test/test.geocoder.js +++ b/test/test.geocoder.js @@ -65,10 +65,10 @@ test('geocoder', function(tt) { ] }); - geocoder.query('Paris'); + geocoder.query('London'); geocoder.on('results', once(function(e) { t.ok(e.results.length, 'Event for results emitted'); - t.equals(e.results[0].text, 'Paris Jewelry', 'Result is returned within a bbox'); + t.equals(e.results[0].text, 'London Sole', 'Result is returned within a bbox'); })); }); @@ -78,7 +78,7 @@ test('geocoder', function(tt) { geocoder.query('1714 14th St NW'); geocoder.on('result', once(function() { map.once(map.on('moveend', function() { - t.equals(map.getZoom(), 12, 'Custom zoom is supported'); + t.equals(parseInt(map.getZoom()), 12, 'Custom zoom is supported'); })); })); }); diff --git a/test/test.ui.js b/test/test.ui.js index 3d5ccda5..507f9acf 100644 --- a/test/test.ui.js +++ b/test/test.ui.js @@ -21,7 +21,7 @@ test('Geocoder#inputControl', function(tt) { tt.test('input', function(t) { setup(); - t.plan(8); + t.plan(10); var inputEl = container.querySelector('.mapboxgl-ctrl-geocoder input'); var clearEl = container.querySelector('.mapboxgl-ctrl-geocoder button'); inputEl.addEventListener('change', once(function() { @@ -42,6 +42,12 @@ test('Geocoder#inputControl', function(tt) { t.equals(inputEl.value, 'Paris', 'value populates in input'); t.ok(clearEl.classList.contains('active'), 'clear link is active'); t.notOk(geocoder.getResult(), 'input is set but result is null'); + + geocoder.setInput([90, 45]); + t.equals(inputEl.value, '90,45', 'valid LngLat value populates in input'); + + geocoder.setInput([270, 45]); + t.equals(inputEl.value, '-90,45', 'LngLat wraps if need be'); })); geocoder.query([-79, 43]);