Skip to content

Commit 02bd7da

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

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/lib/rules/prop-types.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3871,6 +3871,46 @@ ruleTester.run('prop-types', rule, {
38713871
export default Component;
38723872
`,
38733873
features: ['types'],
3874+
},
3875+
{
3876+
code: `
3877+
export default React.memo(function AppIcon({
3878+
icon,
3879+
className,
3880+
title,
3881+
spinning,
3882+
}: {
3883+
icon: string | IconDefinition;
3884+
className?: string;
3885+
title?: string;
3886+
spinning?: boolean;
3887+
}) {
3888+
if (typeof icon === 'string') {
3889+
return (
3890+
<span
3891+
className={clsx(
3892+
icon,
3893+
'app-icon',
3894+
'no-pointer-events',
3895+
className,
3896+
spinning ? 'fa-spin' : false
3897+
)}
3898+
title={title}
3899+
/>
3900+
);
3901+
} else {
3902+
return (
3903+
<FontAwesomeIcon
3904+
className={className ? 'app-icon ' + className : 'app-icon'}
3905+
icon={icon}
3906+
title={title}
3907+
spin={spinning}
3908+
/>
3909+
);
3910+
}
3911+
});
3912+
`,
3913+
features: ['types'],
38743914
}
38753915
)),
38763916

0 commit comments

Comments
 (0)