From 607b6540913f792674a907fa6e6a699615420637 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Wed, 27 Jun 2018 16:19:55 -0500 Subject: [PATCH] Fix bug in WizardPanel property passing --- .../src/components/common/wizard/WizardPanel.spec.tsx | 2 +- javascripts/src/components/common/wizard/WizardPanel.tsx | 7 ++++--- .../common/wizard/__snapshots__/WizardPanel.spec.tsx.snap | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/javascripts/src/components/common/wizard/WizardPanel.spec.tsx b/javascripts/src/components/common/wizard/WizardPanel.spec.tsx index bbcb2564..bc65bd48 100644 --- a/javascripts/src/components/common/wizard/WizardPanel.spec.tsx +++ b/javascripts/src/components/common/wizard/WizardPanel.spec.tsx @@ -28,7 +28,7 @@ describe('WizardPanel', () => { ws.addTab('something', 'something label',{} ) ws.initialize() - const tree = shallow(
) + const tree = shallow(
) expect(toJson(tree)).toMatchSnapshot() diff --git a/javascripts/src/components/common/wizard/WizardPanel.tsx b/javascripts/src/components/common/wizard/WizardPanel.tsx index f9bc4fbf..31ab27c4 100644 --- a/javascripts/src/components/common/wizard/WizardPanel.tsx +++ b/javascripts/src/components/common/wizard/WizardPanel.tsx @@ -4,6 +4,7 @@ import { TabPanel } from "react-aria-tabpanel"; import { observer } from 'mobx-react' import { WizardTabPanelState} from './wizard_state'; import {computed} from 'mobx'; +import * as _ from 'lodash' export interface WizardTabPanelProps { @@ -26,9 +27,9 @@ export class WizardPanel extends React.Component { } render() { - let props = this.props.props ? this.props.props : {} - return + let props = _.omit(this.props, ['tab']) + return {this.props.children} } diff --git a/javascripts/src/components/common/wizard/__snapshots__/WizardPanel.spec.tsx.snap b/javascripts/src/components/common/wizard/__snapshots__/WizardPanel.spec.tsx.snap index ac2e521a..cf091e62 100644 --- a/javascripts/src/components/common/wizard/__snapshots__/WizardPanel.spec.tsx.snap +++ b/javascripts/src/components/common/wizard/__snapshots__/WizardPanel.spec.tsx.snap @@ -3,6 +3,7 @@ exports[`WizardPanel shallow render 1`] = `