Skip to content

Commit 8d8ca3f

Browse files
committed
[Tests] default-props-match-prop-types: add passing test
Closes #1593
1 parent 70dccbe commit 8d8ca3f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/lib/rules/default-props-match-prop-types.js

+27
Original file line numberDiff line numberDiff line change
@@ -1756,5 +1756,32 @@ ruleTester.run('default-props-match-prop-types', rule, {
17561756
},
17571757
],
17581758
},
1759+
{
1760+
code: `
1761+
export type SharedProps = {|
1762+
disabled: boolean,
1763+
|};
1764+
1765+
type Props = {|
1766+
...SharedProps,
1767+
focused?: boolean,
1768+
|};
1769+
1770+
class Foo extends React.Component<Props> {
1771+
static defaultProps = {
1772+
disabled: false
1773+
};
1774+
};
1775+
`,
1776+
features: ['flow'],
1777+
errors: [
1778+
{
1779+
messageId: 'requiredHasDefault',
1780+
data: {
1781+
name: 'disabled',
1782+
},
1783+
},
1784+
],
1785+
},
17591786
]),
17601787
});

0 commit comments

Comments
 (0)