diff --git a/packages/react/components/combobox/__tests__/combobox.test.tsx b/packages/react/components/combobox/__tests__/combobox.test.tsx index 19e28f859..8df68130d 100644 --- a/packages/react/components/combobox/__tests__/combobox.test.tsx +++ b/packages/react/components/combobox/__tests__/combobox.test.tsx @@ -449,6 +449,33 @@ describe('Combobox', () => { const input = screen.getByRole('combobox'); expect(input).toHaveValue('test'); }); + + it('filters items by a controlled inputValue', () => { + const handleInputChange = vi.fn(); + render( + + ); + const input = screen.getByRole('combobox'); + + fireEvent.change(input, { target: { value: 'app' } }); + + expect(handleInputChange).toHaveBeenCalledWith('app'); + expect(input).toHaveValue('ban'); + expect(screen.getByText('Banana')).toBeInTheDocument(); + expect(screen.queryByText('Apple')).not.toBeInTheDocument(); + }); + + it('filters items by defaultInputValue', () => { + render(); + + expect(screen.getByRole('combobox')).toHaveValue('ban'); + expect(screen.getByText('Banana')).toBeInTheDocument(); + expect(screen.queryByText('Apple')).not.toBeInTheDocument(); + }); }); describe('Accessibility', () => {