From 75d5da889858a009b6e25ef8cd000ec8647bc7f1 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Thu, 8 Sep 2022 17:40:06 -0300 Subject: [PATCH] test: Fixes act errors in Alert test (#21386) --- superset-frontend/src/components/Alert/Alert.test.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/components/Alert/Alert.test.tsx b/superset-frontend/src/components/Alert/Alert.test.tsx index 8a59469180..9d921d0301 100644 --- a/superset-frontend/src/components/Alert/Alert.test.tsx +++ b/superset-frontend/src/components/Alert/Alert.test.tsx @@ -64,13 +64,14 @@ test('renders without icon', async () => { }); }); -test('renders message', () => { +test('renders message', async () => { render(); - expect(screen.getByRole('alert')).toHaveTextContent('Message'); + expect(await screen.findByRole('alert')).toHaveTextContent('Message'); }); -test('renders message and description', () => { +test('renders message and description', async () => { render(); - expect(screen.getByRole('alert')).toHaveTextContent('Message'); - expect(screen.getByRole('alert')).toHaveTextContent('Description'); + const alert = await screen.findByRole('alert'); + expect(alert).toHaveTextContent('Message'); + expect(alert).toHaveTextContent('Description'); });