diff --git a/tests/lib/rules/default-props-match-prop-types.js b/tests/lib/rules/default-props-match-prop-types.js index 141c254e7c..f61b5197b1 100644 --- a/tests/lib/rules/default-props-match-prop-types.js +++ b/tests/lib/rules/default-props-match-prop-types.js @@ -1756,5 +1756,32 @@ ruleTester.run('default-props-match-prop-types', rule, { }, ], }, + { + code: ` + export type SharedProps = {| + disabled: boolean, + |}; + + type Props = {| + ...SharedProps, + focused?: boolean, + |}; + + class Foo extends React.Component { + static defaultProps = { + disabled: false + }; + }; + `, + features: ['flow'], + errors: [ + { + messageId: 'requiredHasDefault', + data: { + name: 'disabled', + }, + }, + ], + }, ]), });