From cd246f8625ddd4678da9853fa49e4a9ed938f7c7 Mon Sep 17 00:00:00 2001 From: Gavin Reynolds Date: Fri, 5 Jan 2024 09:55:44 +0000 Subject: [PATCH] Ensure EXTRA_BUTTONS is not null before rendering Signed-off-by: Gavin Reynolds --- src/components/IncidentActions/IncidentActionsComponent.jsx | 2 +- src/setupTests.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/IncidentActions/IncidentActionsComponent.jsx b/src/components/IncidentActions/IncidentActionsComponent.jsx index 2409f6ee..476802aa 100644 --- a/src/components/IncidentActions/IncidentActionsComponent.jsx +++ b/src/components/IncidentActions/IncidentActionsComponent.jsx @@ -51,7 +51,7 @@ const IncidentActionsComponent = () => ( - {EXTRA_BUTTONS.map(({ + {EXTRA_BUTTONS && EXTRA_BUTTONS.map(({ label, url, width, height, }) => ( <> diff --git a/src/setupTests.js b/src/setupTests.js index c04bb28a..3f9b5d12 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -35,6 +35,7 @@ jest.mock('src/config/constants', () => ({ DEBUG_DISABLE_POLLING: false, DEBUG_SINCE_DATE: null, DEBUG_UNTIL_DATE: null, + EXTRA_BUTTONS: null, })); beforeEach(() => {