Skip to content

Commit 504f538

Browse files
committed
Fix failing test due to new semantics of waitFor
1 parent d63e0a4 commit 504f538

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/old-pages/Logs/__tests__/LogStreamsTable.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// limitations under the License.
1111

1212
import {Store} from '@reduxjs/toolkit'
13-
import {render, RenderResult} from '@testing-library/react'
13+
import {render, RenderResult, waitFor} from '@testing-library/react'
1414
import userEvent from '@testing-library/user-event'
1515
import {mock} from 'jest-mock-extended'
1616
import {I18nextProvider, initReactI18next} from 'react-i18next'
@@ -142,7 +142,7 @@ describe('given a component to show the log streams list and a cluster name', ()
142142

143143
describe('when the user selects a log stream', () => {
144144
it('should call the selection handler with the selected log stream name', async () => {
145-
await userEvent.click(screen.getByRole('radio'))
145+
await waitFor(() => userEvent.click(screen.getByRole('radio')))
146146
expect(mockOnLogStreamSelect).toHaveBeenCalledTimes(1)
147147
expect(mockOnLogStreamSelect).toHaveBeenCalledWith(
148148
'hostname.instanceId.logIdentifier',

0 commit comments

Comments
 (0)