Skip to content

Commit

Permalink
Unit test corrections and typo
Browse files Browse the repository at this point in the history
  • Loading branch information
dlnr committed Jun 6, 2024
1 parent c8c6921 commit 380fbc8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 6 additions & 2 deletions packages/react/src/Alert/Alert.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ describe('Alert', () => {
})

it('renders a heading', () => {
const { getByText } = render(<Alert heading="Alert Title" />)
render(<Alert heading="Alert heading" />)

expect(getByText('Alert Title')).toBeInTheDocument()
const heading = screen.getByRole('heading', {
name: 'Alert heading',
})

expect(heading).toBeInTheDocument()
})

it('renders the close button', () => {
Expand Down
8 changes: 6 additions & 2 deletions packages/react/src/Dialog/Dialog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ describe('Dialog', () => {
})

it('renders a heading', () => {
const { getByText } = render(<Dialog heading="Dialog Title" />)
render(<Dialog heading="Dialog Heading" />)

expect(getByText('Dialog Title')).toBeInTheDocument()
const heading = screen.getByRole('heading', {
name: 'Dialog Heading',
})

expect(heading).toBeInTheDocument()
})

it('renders children', () => {
Expand Down
2 changes: 1 addition & 1 deletion storybook/src/components/Header/Header.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ A Page Menu in the Header should not wrap.

<Canvas of={HeaderStories.WithLinks} />

## With app name and menu
## With links and menu

<Canvas of={HeaderStories.WithLinksAndMenu} />

Expand Down

0 comments on commit 380fbc8

Please sign in to comment.