Skip to content

Commit b71b6a4

Browse files
committed
[Tests] prop-types: add passing test
Closes #1280
1 parent 94d647d commit b71b6a4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/lib/rules/prop-types.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3746,6 +3746,35 @@ ruleTester.run('prop-types', rule, {
37463746
37473747
export default MyComponent;
37483748
`,
3749+
},
3750+
{
3751+
code: `
3752+
type Field = {
3753+
value: string,
3754+
error: string,
3755+
}
3756+
3757+
type Form = {
3758+
fields: {
3759+
[string]: Field,
3760+
},
3761+
formError: string,
3762+
}
3763+
3764+
type Props = {
3765+
bankDetails: Form,
3766+
onBankDetailsUpdate: any => void,
3767+
}
3768+
3769+
const Provider = (props:Props) =>
3770+
<Input
3771+
label={'Account Name'}
3772+
value={props.bankDetails.fields.accountName.value}
3773+
error={props.bankDetails.fields.accountName.error}
3774+
onChange={newVal => props.onBankDetailsUpdate({ accountName: newVal })}
3775+
/>
3776+
`,
3777+
features: ['flow'],
37493778
}
37503779
)),
37513780

0 commit comments

Comments
 (0)