From 7476521c57cbafbc1b6b33b9e98cc30aefc045a4 Mon Sep 17 00:00:00 2001 From: Niels Roozemond Date: Fri, 5 Jan 2024 13:50:48 +0100 Subject: [PATCH] Test fix --- packages/react/src/Header/Header.test.tsx | 4 ++-- packages/react/src/Header/Header.tsx | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/react/src/Header/Header.test.tsx b/packages/react/src/Header/Header.test.tsx index 4c5e346ad3..397e975d87 100644 --- a/packages/react/src/Header/Header.test.tsx +++ b/packages/react/src/Header/Header.test.tsx @@ -70,9 +70,9 @@ describe('Header', () => { }) it('renders with menu button', () => { - render(
Menu Button} />) + render(
Navigation} />) - const menu = screen.getByRole('button') + const menu = screen.getByRole('button', { name: 'Open Menu' }) expect(menu).toBeInTheDocument() }) diff --git a/packages/react/src/Header/Header.tsx b/packages/react/src/Header/Header.tsx index 2619baac02..6d80c0de60 100644 --- a/packages/react/src/Header/Header.tsx +++ b/packages/react/src/Header/Header.tsx @@ -91,10 +91,11 @@ export const Header = forwardRef( {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} )}