Skip to content

Commit

Permalink
fix(workflow-select): allow selected workflow to be null (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikThePendric authored Aug 11, 2021
1 parent 749f319 commit 68fd920
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/top-bar/workflow-select/workflow-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
/>
))}
Expand All @@ -54,3 +54,4 @@ const WorkflowSelect = () => {
}

export { WorkflowSelect, WORKFLOW }
//
2 changes: 1 addition & 1 deletion src/top-bar/workflow-select/workflow-select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ afterEach(() => {
describe('<WorkflowSelect>', () => {
it('renders a ContextSelect with WorkflowSelectOptions', () => {
useSelectionContext.mockImplementation(() => ({
workflow: {},
workflow: null,
openedSelect: '',
selectWorkflow: () => {},
setOpenedSelect: () => {},
Expand Down

0 comments on commit 68fd920

Please sign in to comment.