mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-06 07:48:06 +00:00
fix(ui): restore search tool clear action
This commit is contained in:
parent
ea9d80ef50
commit
4a2ed16102
3 changed files with 13 additions and 0 deletions
|
|
@ -31,4 +31,14 @@ describe("SearchToolSelector", () => {
|
|||
expect(await screen.findByRole("option", { name: "search-one" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("option", { name: "search-two" })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("should clear all selected search tools", async () => {
|
||||
const user = userEvent.setup();
|
||||
const onChange = vi.fn();
|
||||
renderWithProviders(<SearchToolSelector accessToken="" value={["search-one", "search-two"]} onChange={onChange} />);
|
||||
|
||||
await user.click(screen.getByRole("button", { name: "Clear all search tools" }));
|
||||
|
||||
expect(onChange).toHaveBeenCalledWith([]);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {
|
|||
ComboboxChip,
|
||||
ComboboxChips,
|
||||
ComboboxChipsInput,
|
||||
ComboboxClear,
|
||||
ComboboxContent,
|
||||
ComboboxEmpty,
|
||||
ComboboxItem,
|
||||
|
|
@ -82,6 +83,7 @@ const SearchToolSelector: React.FC<SearchToolSelectorProps> = ({
|
|||
aria-label={placeholder}
|
||||
disabled={disabled}
|
||||
/>
|
||||
{value && value.length > 0 && <ComboboxClear aria-label="Clear all search tools" disabled={disabled} />}
|
||||
</ComboboxChips>
|
||||
<ComboboxContent>
|
||||
<ComboboxEmpty>{loading ? "Loading search tools…" : "No search tools found"}</ComboboxEmpty>
|
||||
|
|
|
|||
|
|
@ -260,6 +260,7 @@ export {
|
|||
ComboboxChips,
|
||||
ComboboxChip,
|
||||
ComboboxChipsInput,
|
||||
ComboboxClear,
|
||||
ComboboxTrigger,
|
||||
ComboboxValue,
|
||||
useComboboxAnchor,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue