diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Dropdown_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Dropdown_spec.js index 1d550d9ca0..3d462ac092 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Dropdown_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Dropdown_spec.js @@ -8,9 +8,6 @@ describe("Dropdown Widget Functionality", function() { before(() => { cy.addDsl(dsl); }); - beforeEach(() => { - cy.wait(7000); - }); it("Add new dropdown widget", () => { cy.get(explorer.addWidget).click(); @@ -93,6 +90,50 @@ describe("Dropdown Widget Functionality", function() { cy.get(formWidgetsPage.dropdownDefaultButton).should("contain", "Blue"); }); + it("should check that special strings are parsed as string in default value", () => { + cy.openPropertyPane("selectwidget"); + cy.updateCodeInput( + ".t--property-control-options", + `[{ + "label": "Blue", + "value": "null" + }, + { + "label": "Green", + "value": 100 + }, + { + "label": "Red", + "value": "120" + }]`, + ); + cy.updateCodeInput(".t--property-control-defaultvalue", "null"); + cy.get(".t--property-control-defaultvalue .t--codemirror-has-error").should( + "not.exist", + ); + cy.get(formWidgetsPage.dropdownDefaultButton).should("contain", "Blue"); + + cy.openPropertyPane("selectwidget"); + cy.updateCodeInput(".t--property-control-defaultvalue", "120"); + cy.get(".t--property-control-defaultvalue .t--codemirror-has-error").should( + "not.exist", + ); + cy.get(formWidgetsPage.dropdownDefaultButton).should("contain", "Red"); + + cy.openPropertyPane("selectwidget"); + cy.updateCodeInput(".t--property-control-defaultvalue", "{{ 100 }}"); + cy.get(".t--property-control-defaultvalue .t--codemirror-has-error").should( + "not.exist", + ); + cy.get(formWidgetsPage.dropdownDefaultButton).should("contain", "Green"); + + cy.openPropertyPane("selectwidget"); + cy.updateCodeInput(".t--property-control-defaultvalue", "{{ null }}"); + cy.get(".t--property-control-defaultvalue .t--codemirror-has-error").should( + "exist", + ); + }); + it("Dropdown Functionality To Check disabled Widget", function() { cy.openPropertyPane("selectwidget"); // Disable the visible JS diff --git a/app/client/src/widgets/SelectWidget/widget/index.test.tsx b/app/client/src/widgets/SelectWidget/widget/index.test.tsx index 7c11839c64..5c6bd0ff9b 100644 --- a/app/client/src/widgets/SelectWidget/widget/index.test.tsx +++ b/app/client/src/widgets/SelectWidget/widget/index.test.tsx @@ -15,14 +15,6 @@ describe("defaultOptionValueValidation - ", () => { }); it("should get tested with number", () => { const testValues = [ - [ - "{{1}}", - { - isValid: true, - parsed: 1, - messages: [""], - }, - ], [ "1", {