From 90aa086de06918f56ddb1700dd8afd3ba0ba8299 Mon Sep 17 00:00:00 2001 From: Niels Roozemond Date: Tue, 14 May 2024 10:35:50 +0200 Subject: [PATCH] Update packages/react/src/Alert/Alert.test.tsx Co-authored-by: Aram <37216945+alimpens@users.noreply.github.com> --- packages/react/src/Alert/Alert.test.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/react/src/Alert/Alert.test.tsx b/packages/react/src/Alert/Alert.test.tsx index ecc1331366..82cd201905 100644 --- a/packages/react/src/Alert/Alert.test.tsx +++ b/packages/react/src/Alert/Alert.test.tsx @@ -55,10 +55,9 @@ describe('Alert', () => { it('renders the close button with a label', () => { const { container } = render() - const component = container.querySelector(':only-child') - const closeButton = component?.querySelector('.ams-icon-button') + const closeButton = screen.getByRole('button', { name: 'Close' }) - expect(closeButton).toHaveTextContent('Close') + expect(closeButton).toBeInTheDocument() }) it('fires the onClose event when the close button is clicked', () => {