diff --git a/ui/src/picker.test.tsx b/ui/src/picker.test.tsx index 6a1874742e..b3a8c3ddf0 100644 --- a/ui/src/picker.test.tsx +++ b/ui/src/picker.test.tsx @@ -160,15 +160,20 @@ describe('Picker.tsx', () => { }) it('Filters correctly - does not offer already selected - without input provided', () => { - const { getByRole, queryByRole } = render() + const { getByRole, queryByRole, getAllByRole } = render() const input = (getByRole('combobox') as HTMLInputElement) + fireEvent.click(input) + expect(getAllByRole('option')).toHaveLength(2) typeToInput(input, name) fireEvent.click(getByRole('option')) + + fireEvent.click(input) + expect(getAllByRole('option')).toHaveLength(1) typeToInput(input, altName) fireEvent.click(getByRole('option')) - fireEvent.click(input) + fireEvent.click(input) expect(queryByRole('option')?.querySelector('.ms-Suggestions-none')).toBeInTheDocument() })