diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/CheckboxGroup_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/CheckboxGroup_spec.js index 26acce57ab..6ee13ff1e4 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/CheckboxGroup_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/FormWidgets/CheckboxGroup_spec.js @@ -45,6 +45,10 @@ describe("Checkbox Group Widget Functionality", function() { "not.have.value", "test4", ); + cy.get(formWidgetsPage.deleteradiovalue) + .eq(2) + .click({ force: true }); + cy.wait(200); /** * @param{Show Alert} Css for InputChange */ diff --git a/app/client/src/workers/validations.test.ts b/app/client/src/workers/validations.test.ts index 2c1b64d840..79e277d318 100644 --- a/app/client/src/workers/validations.test.ts +++ b/app/client/src/workers/validations.test.ts @@ -74,8 +74,11 @@ describe("Validate Validators", () => { parsed: "123", }, { - isValid: true, - parsed: "", + isValid: false, + parsed: "abc", + messages: [ + `${WIDGET_TYPE_VALIDATION_ERROR} string ( abc | 123 | mno | test )`, + ], }, ]; inputs.forEach((input, index) => { @@ -101,10 +104,7 @@ describe("Validate Validators", () => { ]; const expected = [ { - isValid: false, - messages: [ - "This value does not evaluate to type (http(s)?:\\/\\/.)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&\\/=]*)", - ], + isValid: true, parsed: "https://www.appsmith.com", }, { @@ -152,8 +152,7 @@ describe("Validate Validators", () => { ]; const expected = [ { - isValid: false, - messages: ["This value does not evaluate to type URL"], + isValid: true, parsed: "https://www.appsmith.com", }, { @@ -192,7 +191,7 @@ describe("Validate Validators", () => { const expected = [ { isValid: true, - parsed: "", + parsed: "abc", }, ]; inputs.forEach((input, index) => { diff --git a/app/client/src/workers/validations.ts b/app/client/src/workers/validations.ts index 9a0f6bd37a..3d902729c6 100644 --- a/app/client/src/workers/validations.ts +++ b/app/client/src/workers/validations.ts @@ -300,7 +300,7 @@ export const VALIDATORS: Record = { value: unknown, props: Record, ): ValidationResponse => { - if (value === undefined || value === null) { + if (value === undefined || value === null || value === "") { if (config.params && config.params.required) { return { isValid: false, @@ -342,9 +342,7 @@ export const VALIDATORS: Record = { return stringValidationError; } } - // If the value is an empty string we skip - // as we do not mark the field as an error - if (config.params?.allowedValues && value !== "") { + if (config.params?.allowedValues) { if (!config.params?.allowedValues.includes((parsed as string).trim())) { return { parsed: config.params?.default || "",