Skip to content

Commit

Permalink
fix spark-react test errors by adding react component proptype, see: f…
Browse files Browse the repository at this point in the history
  • Loading branch information
afebbraro committed Oct 26, 2019
1 parent 7136367 commit 2ee2efe
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion react/src/base/links/SprkLink.js
Expand Up @@ -90,7 +90,11 @@ SprkLink.propTypes = {
/** The href value for the link. */
href: PropTypes.string,
/** The element that will be rendered. */
element: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
element: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.elementType
]),
/** The event that will fire when the element is clicked. */
onClick: PropTypes.func,
};
Expand Down
Expand Up @@ -207,15 +207,23 @@ SprkCardTeaser.propTypes = {
additionalCtaIconClasses: PropTypes.string,
ctaAnalytics: PropTypes.string,
ctaIcon: PropTypes.string,
ctaLinkElement: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
ctaLinkElement: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.elementType
]),
ctaVariant: PropTypes.oneOf(['link', 'button']),
href: PropTypes.string,
text: PropTypes.string,
}),
media: PropTypes.shape({
additionalMediaIconClasses: PropTypes.string,
href: PropTypes.string,
mediaLinkElement: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
mediaLinkElement: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.elementType
]),
iconName: PropTypes.string,
imgAlt: PropTypes.string,
imgSrc: PropTypes.string,
Expand Down
6 changes: 5 additions & 1 deletion react/src/components/masthead/SprkMasthead.js
Expand Up @@ -323,7 +323,11 @@ SprkMasthead.propTypes = {
/** The href to render for the logo link. */
logoLink: PropTypes.string,
/** The element link element to render for the logo. */
logoLinkElement: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
logoLinkElement: PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.elementType
]),
/** Expects a component to render the nav link. */
navLink: PropTypes.node,
};
Expand Down

0 comments on commit 2ee2efe

Please sign in to comment.