From 68fd920c7f5659b6a2257de3009331f208d00d81 Mon Sep 17 00:00:00 2001 From: Hendrik de Graaf Date: Wed, 11 Aug 2021 09:48:24 +0200 Subject: [PATCH] fix(workflow-select): allow selected workflow to be null (#40) --- src/top-bar/workflow-select/workflow-select.js | 3 ++- src/top-bar/workflow-select/workflow-select.test.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/top-bar/workflow-select/workflow-select.js b/src/top-bar/workflow-select/workflow-select.js index 3426bfb4..b13700ac 100644 --- a/src/top-bar/workflow-select/workflow-select.js +++ b/src/top-bar/workflow-select/workflow-select.js @@ -43,7 +43,7 @@ const WorkflowSelect = () => { id={workflow.id} name={workflow.displayName} periodType={workflow.periodType} - active={workflow.id === selectedWorkflow.id} + active={workflow.id === selectedWorkflow?.id} onClick={() => selectWorkflow(workflow)} /> ))} @@ -54,3 +54,4 @@ const WorkflowSelect = () => { } export { WorkflowSelect, WORKFLOW } +// diff --git a/src/top-bar/workflow-select/workflow-select.test.js b/src/top-bar/workflow-select/workflow-select.test.js index 89000360..84c0cdde 100644 --- a/src/top-bar/workflow-select/workflow-select.test.js +++ b/src/top-bar/workflow-select/workflow-select.test.js @@ -45,7 +45,7 @@ afterEach(() => { describe('', () => { it('renders a ContextSelect with WorkflowSelectOptions', () => { useSelectionContext.mockImplementation(() => ({ - workflow: {}, + workflow: null, openedSelect: '', selectWorkflow: () => {}, setOpenedSelect: () => {},