Skip to content

Commit 993ee22

Browse files
committed
[Tests] prop-types: add passing test
Closes #2824
1 parent 02bd7da commit 993ee22

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
@@ -3911,6 +3911,35 @@ ruleTester.run('prop-types', rule, {
39113911
});
39123912
`,
39133913
features: ['types'],
3914+
},
3915+
{
3916+
code: `
3917+
import PropTypes from 'prop-types';
3918+
import React from 'react';
3919+
3920+
import { Link } from '..';
3921+
3922+
const LinkWrapper = ({ primaryLinks }) => (
3923+
<>
3924+
{primaryLinks.map((x, index) => (
3925+
<Link key={index} href={x.link}>
3926+
{x.text}
3927+
</Link>
3928+
))}
3929+
</>
3930+
);
3931+
3932+
LinkWrapper.propTypes = {
3933+
primaryLinks: PropTypes.arrayOf(
3934+
PropTypes.shape({
3935+
text: PropTypes.string,
3936+
})
3937+
),
3938+
};
3939+
3940+
export default LinkWrapper;
3941+
`,
3942+
features: ['fragment'],
39143943
}
39153944
)),
39163945

0 commit comments

Comments
 (0)