From 9f3ed3d0ecfb449c52ccaa7d7051fdffdf87d6a9 Mon Sep 17 00:00:00 2001 From: regexowl Date: Mon, 28 Aug 2023 14:43:15 +0200 Subject: [PATCH] test: Update testUtils This updates `clickBack`, `clickCancel` and `clickNext` functions in testUtils.js --- src/test/testUtils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/testUtils.js b/src/test/testUtils.js index 8c885f4d..37f0a906 100644 --- a/src/test/testUtils.js +++ b/src/test/testUtils.js @@ -77,17 +77,17 @@ export const renderWithProvider = ( export const clickBack = async () => { const user = userEvent.setup(); - await user.click(screen.getByRole('button', { name: /Back/ })); + await user.click(await screen.findByRole('button', { name: /Back/ })); }; export const clickNext = async () => { const user = userEvent.setup(); - await user.click(screen.getByRole('button', { name: /Next/ })); + await user.click(await screen.findByRole('button', { name: /Next/ })); }; export const clickCancel = async () => { const user = userEvent.setup(); - await user.click(screen.getByRole('button', { name: /Cancel/ })); + await user.click(await screen.findByRole('button', { name: /Cancel/ })); }; export const getNextButton = async () => {