Skip to content

Commit

Permalink
Fix: linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
prasad-madine committed Oct 1, 2024
1 parent a328709 commit 0519280
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/client/src/widgets/SelectWidget/component/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import { act, fireEvent, render, screen } from "@testing-library/react";
import SelectComponent, { type SelectComponentProps } from "./index";
import userEvent from "@testing-library/user-event";

const mockProps: SelectComponentProps = {
borderRadius: "",
Expand All @@ -26,10 +25,11 @@ describe("SelectComponent", () => {
it("should call onDropdownClose only once when select button is clicked twice", () => {
render(<SelectComponent {...mockProps} />);
const dropdownButton = screen.getByTestId("selectbutton.btn.main");
userEvent.click(dropdownButton);

fireEvent.click(dropdownButton);

expect(mockProps.onDropdownOpen).toHaveBeenCalledTimes(1);
userEvent.click(dropdownButton);
fireEvent.click(dropdownButton);

expect(mockProps.onDropdownClose).toHaveBeenCalledTimes(1);
});
Expand Down
1 change: 1 addition & 0 deletions app/client/src/widgets/SelectWidget/component/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class SelectComponent extends React.Component<
handleCloseList = () => {
if (this.state.isOpen) {
this.togglePopoverVisibility();

if (!this.props.selectedIndex) return;

return this.handleActiveItemChange(
Expand Down

0 comments on commit 0519280

Please sign in to comment.