diff --git a/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CurrencyField_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CurrencyField_spec.ts new file mode 100644 index 0000000000..42a3a5f0dc --- /dev/null +++ b/app/client/cypress/e2e/Regression/ClientSide/Widgets/JSONForm/JSONForm_CurrencyField_spec.ts @@ -0,0 +1,30 @@ +import { + entityExplorer, + propPane, + agHelper, + draggableWidgets, + deployMode, + table, + locators, +} from "../../../../../support/Objects/ObjectsCore"; + +describe("Modal Widget background color spec", () => { + before(() => { + // Add a JSON form widget and change field type of one of the fields + entityExplorer.DragDropWidgetNVerify(draggableWidgets.JSONFORM, 300, 100); + propPane.ChangeJsonFormFieldType("Employee Id", "Currency Input"); + }); + + it("1. should check that value entered in currency field appears in the actual field", () => { + /** + * This case is for checking the following bug: https://github.com/appsmithorg/appsmith/issues/23671 + * This issue introduced a behaviour by which for currency field type in JSON form, users where not able to enter/type any value into it. + **/ + agHelper + .GetElement(locators._jsonFormInputField("employee_id")) + .type("123"); + agHelper + .GetText(locators._jsonFormInputField("employee_id"), "val") + .should("be.equal", "1001123"); + }); +}); diff --git a/app/client/cypress/locators/WidgetLocators.ts b/app/client/cypress/locators/WidgetLocators.ts index 01cf01b134..1139deaa68 100644 --- a/app/client/cypress/locators/WidgetLocators.ts +++ b/app/client/cypress/locators/WidgetLocators.ts @@ -40,6 +40,7 @@ export const WIDGET = { ICONBUTTON: "iconbuttonwidget", IMAGE: "imagewidget", STATBOX: "statboxwidget", + JSONFORM: "jsonformwidget" } as const; // property pane element selector are maintained here diff --git a/app/client/src/widgets/JSONFormWidget/fields/CurrencyInputField.tsx b/app/client/src/widgets/JSONFormWidget/fields/CurrencyInputField.tsx index 8b37951fb5..6507339f31 100644 --- a/app/client/src/widgets/JSONFormWidget/fields/CurrencyInputField.tsx +++ b/app/client/src/widgets/JSONFormWidget/fields/CurrencyInputField.tsx @@ -1,5 +1,5 @@ import * as Sentry from "@sentry/react"; -import _ from "lodash"; +import _ from "workers/common/JSLibrary/lodash-wrapper"; import moment from "moment"; import React, { useCallback, useContext, useMemo, useState } from "react";