fix: add full stop to option ingredient validation error message

This commit is contained in:
mansiverma897993 2026-07-02 16:25:06 +05:30
parent 1e2e200bd3
commit 8422947b52
3 changed files with 4 additions and 4 deletions

View File

@ -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(", ")}.`);
} }
} }
} }

View File

@ -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",

View File

@ -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",