Skip to content

Commit d6f087e

Browse files
authored
Validate empty Show On Map options (#2631)
1 parent 3c32e3f commit d6f087e

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

src/core/operations/ShowOnMap.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ class ShowOnMap extends Operation {
3636
{
3737
name: "Input Format",
3838
type: "option",
39-
value: ["Auto"].concat(FORMATS)
39+
value: ["Auto"].concat(FORMATS),
40+
allowEmpty: false
4041
},
4142
{
4243
name: "Input Delimiter",
@@ -49,7 +50,8 @@ class ShowOnMap extends Operation {
4950
"Comma",
5051
"Semi-colon",
5152
"Colon"
52-
]
53+
],
54+
allowEmpty: false
5355
}
5456
];
5557
}

tests/operations/tests/ShowOnMap.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,26 @@ TestRegister.addTests([
3636
},
3737
],
3838
},
39+
{
40+
name: "Show on map: empty input format is rejected",
41+
input: "1, 24",
42+
expectedOutput: "Input Format cannot be empty.",
43+
recipeConfig: [
44+
{
45+
op: "Show on map",
46+
args: [13, "", "Auto"]
47+
},
48+
],
49+
},
50+
{
51+
name: "Show on map: empty input delimiter is rejected",
52+
input: "1, 24",
53+
expectedOutput: "Input Delimiter cannot be empty.",
54+
recipeConfig: [
55+
{
56+
op: "Show on map",
57+
args: [13, "Auto", ""]
58+
},
59+
],
60+
},
3961
]);

0 commit comments

Comments
 (0)