diff --git a/packages/big-design/src/components/Alert/spec.tsx b/packages/big-design/src/components/Alert/spec.tsx index d00d6268e..2bce4a0ae 100644 --- a/packages/big-design/src/components/Alert/spec.tsx +++ b/packages/big-design/src/components/Alert/spec.tsx @@ -93,7 +93,7 @@ test('trigger onClose', async () => { const fn = jest.fn(); render(); - const button = screen.getByRole('button') as HTMLButtonElement; + const button = await screen.findByRole('button'); fireEvent.click(button);