Spelling.
This commit is contained in:
parent
b683f0239c
commit
aae2312a5a
@ -78,7 +78,7 @@ class ShowOnMap extends Operation {
|
|||||||
// uncaught TypeError in the browser.
|
// uncaught TypeError in the browser.
|
||||||
const coords = latLong.split(",").map(v => v.trim());
|
const coords = latLong.split(",").map(v => v.trim());
|
||||||
if (coords.length !== 2 || coords.some(v => v === "" || isNaN(Number(v)))) {
|
if (coords.length !== 2 || coords.some(v => v === "" || isNaN(Number(v)))) {
|
||||||
throw new OperationError(`Could not show co-ordinates '${latLong}' on the map. Expected a latitude and longitude pair - check that the input format and delimiter are correct.`);
|
throw new OperationError(`Could not show coordinates '${latLong}' on the map. Expected a latitude and longitude pair - check that the input format and delimiter are correct.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return latLong;
|
return latLong;
|
||||||
|
|||||||
@ -10,9 +10,9 @@ import TestRegister from "../../lib/TestRegister.mjs";
|
|||||||
|
|
||||||
TestRegister.addTests([
|
TestRegister.addTests([
|
||||||
{
|
{
|
||||||
name: "Show on map: valid co-ordinate pair",
|
name: "Show on map: valid coordinate pair",
|
||||||
input: "51.5007, -0.1246",
|
input: "51.5007, -0.1246",
|
||||||
// The presented output is the Leaflet map HTML; just check the co-ordinates made it through.
|
// The presented output is the Leaflet map HTML; just check the coordinates made it through.
|
||||||
expectedMatch: /51\.5007,-0\.1246/,
|
expectedMatch: /51\.5007,-0\.1246/,
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
{
|
{
|
||||||
@ -24,11 +24,11 @@ TestRegister.addTests([
|
|||||||
{
|
{
|
||||||
// Regression test: a comma-separated input with the delimiter set to "\n" used to be
|
// Regression test: a comma-separated input with the delimiter set to "\n" used to be
|
||||||
// mis-detected as a single Degrees Decimal Minutes value (1° 24' = 1.4°), producing a single
|
// mis-detected as a single Degrees Decimal Minutes value (1° 24' = 1.4°), producing a single
|
||||||
// co-ordinate. That single value was then passed to Leaflet's setView([1.4], ...), throwing
|
// coordinate. That single value was then passed to Leaflet's setView([1.4], ...), throwing
|
||||||
// an uncaught "Cannot read properties of null (reading 'lat')" TypeError in the browser.
|
// an uncaught "Cannot read properties of null (reading 'lat')" TypeError in the browser.
|
||||||
name: "Show on map: single value is rejected with a helpful error",
|
name: "Show on map: single value is rejected with a helpful error",
|
||||||
input: "1, 24",
|
input: "1, 24",
|
||||||
expectedOutput: "Could not show co-ordinates '1.4' on the map. Expected a latitude and longitude pair - check that the input format and delimiter are correct.",
|
expectedOutput: "Could not show coordinates '1.4' on the map. Expected a latitude and longitude pair - check that the input format and delimiter are correct.",
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
{
|
{
|
||||||
op: "Show on map",
|
op: "Show on map",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user