Skip to content

Commit

Permalink
Test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dlnr committed Jan 5, 2024
1 parent 89fbc3b commit 7476521
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/Header/Header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ describe('Header', () => {
})

it('renders with menu button', () => {
render(<Header {...defaultProps} menu={<button>Menu Button</button>} />)
render(<Header {...defaultProps} menu={<nav>Navigation</nav>} />)

const menu = screen.getByRole('button')
const menu = screen.getByRole('button', { name: 'Open Menu' })

expect(menu).toBeInTheDocument()
})
Expand Down
9 changes: 5 additions & 4 deletions packages/react/src/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ export const Header = forwardRef(
</Grid>
{menu && (
<MegaMenu isOpen={isMegaMenuOpen} className="amsterdam-header__mega-menu">
{cloneElement(links as ReactElement, {
alignEnd: false,
className: 'amsterdam-page-menu--links',
})}
{links &&
cloneElement(links as ReactElement, {
alignEnd: false,
className: 'amsterdam-page-menu--links',
})}
{menu}
</MegaMenu>
)}
Expand Down

0 comments on commit 7476521

Please sign in to comment.