From 5d0b10a5b8ed5984f85dd277e76b23ee1e5a150a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 11 Jan 2023 13:13:27 -0600 Subject: [PATCH] Fix toast test --- .../features/verification/__tests__/registration.test.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/soapbox/features/verification/__tests__/registration.test.tsx b/app/soapbox/features/verification/__tests__/registration.test.tsx index e706b71c0..8dfe3083f 100644 --- a/app/soapbox/features/verification/__tests__/registration.test.tsx +++ b/app/soapbox/features/verification/__tests__/registration.test.tsx @@ -75,7 +75,10 @@ describe('', () => { fireEvent.submit(screen.getByTestId('button'), { preventDefault: () => {} }); }); - expect(screen.getByTestId('toast')).toHaveTextContent(/this username is unavailable/i); + await waitFor(() => { + expect(screen.getByTestId('toast')).toHaveTextContent(/this username is unavailable/i); + }); + }); it('handles generic errors', async() => {