Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/runtime/src/widgets/Form/__tests__/MultiSelect.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,18 @@ describe("MultiSelect Widget", () => {
expect(screen.queryByText("Option 3")).not.toBeInTheDocument();
expect(screen.queryByText("Option 44", { selector })).toBeVisible();
});

// clear search value to show all options
userEvent.clear(document.querySelector("input") as HTMLElement);

// Wait for the combobox to reflect the selected values
await waitFor(() => {
expect(screen.getByText("Option 4", { selector })).toBeVisible();
expect(screen.queryByText("Option 1", { selector })).toBeVisible();
expect(screen.queryByText("Option 2", { selector })).toBeVisible();
expect(screen.queryByText("Option 3", { selector })).toBeVisible();
expect(screen.queryByText("Option 44", { selector })).toBeVisible();
});
});
Comment on lines +541 to 552
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this not be visible? Can we make this into a separate test?

});
/* eslint-enable react/no-children-prop */
2 changes: 1 addition & 1 deletion packages/runtime/src/widgets/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const Search: React.FC<SearchProps> = ({

useDebounce(
() => {
if (onSearchAction?.callback) {
if (onSearchAction?.callback && !isEmpty(searchValue)) {
onSearchAction.callback({ search: searchValue });
}
},
Expand Down
Loading