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');
});