From bfee94f0c51c3e86e42bbb6045cc9692940f77b9 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 14 Oct 2023 13:40:34 +0200 Subject: [PATCH] search-react: test fix for RTL 14 Signed-off-by: Patrik Oldsberg --- .../search-react/src/components/SearchBar/SearchBar.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx b/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx index ce3c285852..d9b29584f8 100644 --- a/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx +++ b/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx @@ -318,7 +318,7 @@ describe('SearchBar', () => { , ); - const textbox = screen.getByLabelText('Search'); + const textbox = screen.getByLabelText('Search'); let value = 'value'; await user.type(textbox, value); @@ -339,6 +339,8 @@ describe('SearchBar', () => { value = 'new value'; await user.clear(textbox); + await waitFor(() => expect(textbox.value).toBe('')); + // make sure new term is captured await user.type(textbox, value); await waitFor(() => {