From 380fbc8c5d60694efe9668863f961a29a7d968e4 Mon Sep 17 00:00:00 2001 From: Niels Roozemond Date: Thu, 6 Jun 2024 15:45:46 +0200 Subject: [PATCH] Unit test corrections and typo --- packages/react/src/Alert/Alert.test.tsx | 8 ++++++-- packages/react/src/Dialog/Dialog.test.tsx | 8 ++++++-- storybook/src/components/Header/Header.docs.mdx | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/react/src/Alert/Alert.test.tsx b/packages/react/src/Alert/Alert.test.tsx index 204e4c303f..b905236e11 100644 --- a/packages/react/src/Alert/Alert.test.tsx +++ b/packages/react/src/Alert/Alert.test.tsx @@ -43,9 +43,13 @@ describe('Alert', () => { }) it('renders a heading', () => { - const { getByText } = render() + render() - expect(getByText('Alert Title')).toBeInTheDocument() + const heading = screen.getByRole('heading', { + name: 'Alert heading', + }) + + expect(heading).toBeInTheDocument() }) it('renders the close button', () => { diff --git a/packages/react/src/Dialog/Dialog.test.tsx b/packages/react/src/Dialog/Dialog.test.tsx index 724081990f..b0dc02b1d8 100644 --- a/packages/react/src/Dialog/Dialog.test.tsx +++ b/packages/react/src/Dialog/Dialog.test.tsx @@ -51,9 +51,13 @@ describe('Dialog', () => { }) it('renders a heading', () => { - const { getByText } = render() + render() - expect(getByText('Dialog Title')).toBeInTheDocument() + const heading = screen.getByRole('heading', { + name: 'Dialog Heading', + }) + + expect(heading).toBeInTheDocument() }) it('renders children', () => { diff --git a/storybook/src/components/Header/Header.docs.mdx b/storybook/src/components/Header/Header.docs.mdx index 6ee030a9e2..83dedbe82a 100644 --- a/storybook/src/components/Header/Header.docs.mdx +++ b/storybook/src/components/Header/Header.docs.mdx @@ -32,7 +32,7 @@ A Page Menu in the Header should not wrap. -## With app name and menu +## With links and menu