Skip to content

Commit

Permalink
[Tests] prop-types: add case from #2134
Browse files Browse the repository at this point in the history
Closes #2134
  • Loading branch information
ljharb committed Jan 17, 2019
1 parent df7ffc1 commit 536bc35
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/lib/rules/prop-types.js
Expand Up @@ -4414,6 +4414,34 @@ ruleTester.run('prop-types', rule, {
errors: [{
message: '\'a\' is missing in props validation'
}]
},
{
code: `
class Foo extends React.Component {
contructor(props) {
super(props);
this.initialValues = {
test: '',
};
}
render = () => {
return (
<Component
initialValues={this.props.initialValues || this.initialValues}
>
{formikProps => (
<Input {...formikProps} />
)}
</Component>
);
}
}
`,
parser: 'babel-eslint',
errors: [{
message: '\'initialValues\' is missing in props validation'
}]
}
]
});

0 comments on commit 536bc35

Please sign in to comment.