From e68805410fde7effdb6e677f04d922def41bd470 Mon Sep 17 00:00:00 2001 From: Marek Mihok Date: Mon, 20 Nov 2023 11:33:41 +0100 Subject: [PATCH] chore: make test more strict #1985 --- ui/src/picker.test.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/src/picker.test.tsx b/ui/src/picker.test.tsx index 6a1874742e7..b3a8c3ddf0b 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() })