Skip to content

Commit

Permalink
fixed the bug alert message is showing twice in select widget and add…
Browse files Browse the repository at this point in the history
…ed cypress testing for the same
  • Loading branch information
prasad-madine committed Jul 9, 2024
1 parent fe0ccaa commit 86c083e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {
agHelper,
draggableWidgets,
deployMode,
entityExplorer,
locators,
propPane,
} from "../../../../../support/Objects/ObjectsCore";

describe(
"Select widget tests",
{ tags: ["@tag.Widget", "@tag.Select"] },
function () {
before(() => {
entityExplorer.DragDropWidgetNVerify(draggableWidgets.SELECT);
});


it("Validate OnDropdownClose events are rendering show alert only once", () => {
propPane.EnterJSContext(
"onDropdownClose",
"{{showAlert('Dropdown closed!','success')}}",
true,
);
propPane.ToggleJSMode("onDropdownClose", false);
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.SELECT));
agHelper.GetNClick(locators._widgetInDeployed(draggableWidgets.SELECT));
agHelper.AssertElementVisibility(
locators._selectOptionValue("Red"),
true,
);
agHelper.GetNClick(locators._selectOptionValue("Red"));
agHelper.ValidateToastMessage("Dropdown closed!");
});
},
);

2 changes: 1 addition & 1 deletion app/client/src/widgets/SelectWidget/component/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class SelectComponent extends React.Component<
};
handleCloseList = () => {
if (this.state.isOpen) {
this.togglePopoverVisibility();
// this.togglePopoverVisibility();
if (!this.props.selectedIndex) return;
return this.handleActiveItemChange(
this.props.options[this.props.selectedIndex],
Expand Down

0 comments on commit 86c083e

Please sign in to comment.