fix: add full stop to option ingredient validation error message
This commit is contained in:
parent
1e2e200bd3
commit
8422947b52
@ -145,7 +145,7 @@ class Ingredient {
|
|||||||
const valStr = (checkVal !== null && checkVal !== undefined) ? String(checkVal).toLowerCase() : "";
|
const valStr = (checkVal !== null && checkVal !== undefined) ? String(checkVal).toLowerCase() : "";
|
||||||
const matchedOption = permittedOptions.find(opt => opt.toLowerCase() === valStr);
|
const matchedOption = permittedOptions.find(opt => opt.toLowerCase() === valStr);
|
||||||
if (!matchedOption) {
|
if (!matchedOption) {
|
||||||
throw new OperationError(`${this.name} must be one of the following: ${permittedOptions.join(", ")}`);
|
throw new OperationError(`${this.name} must be one of the following: ${permittedOptions.join(", ")}.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,7 +121,7 @@ TestRegister.addTests([
|
|||||||
{
|
{
|
||||||
name: "Automated Validation: Invalid Option value",
|
name: "Automated Validation: Invalid Option value",
|
||||||
input: "test",
|
input: "test",
|
||||||
expectedOutput: "Option Ingredient must be one of the following: Option 1, Option 2, Option 3",
|
expectedOutput: "Option Ingredient must be one of the following: Option 1, Option 2, Option 3.",
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
{
|
{
|
||||||
op: "Automated Validation Test Op",
|
op: "Automated Validation Test Op",
|
||||||
@ -132,7 +132,7 @@ TestRegister.addTests([
|
|||||||
{
|
{
|
||||||
name: "Automated Validation: Option value as optgroup heading (invalid)",
|
name: "Automated Validation: Option value as optgroup heading (invalid)",
|
||||||
input: "test",
|
input: "test",
|
||||||
expectedOutput: "Option Ingredient must be one of the following: Option 1, Option 2, Option 3",
|
expectedOutput: "Option Ingredient must be one of the following: Option 1, Option 2, Option 3.",
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
{
|
{
|
||||||
op: "Automated Validation Test Op",
|
op: "Automated Validation Test Op",
|
||||||
|
|||||||
@ -67,7 +67,7 @@ TestRegister.addTests([
|
|||||||
{
|
{
|
||||||
name: "Generate Lorem Ipsum: Incorrect lengthType",
|
name: "Generate Lorem Ipsum: Incorrect lengthType",
|
||||||
input: "",
|
input: "",
|
||||||
expectedOutput: "Length in must be one of the following: Paragraphs, Sentences, Words, Bytes",
|
expectedOutput: "Length in must be one of the following: Paragraphs, Sentences, Words, Bytes.",
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
{
|
{
|
||||||
"op": "Generate Lorem Ipsum",
|
"op": "Generate Lorem Ipsum",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user