New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<TooltipIconButton> Tests #179
<TooltipIconButton> Tests #179
Conversation
This wraps the component with the requisite theme provider.
* @return {Object} React component | ||
*/ | ||
export function TooltipIconButton({ | ||
export const TooltipIconButton = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we were using more modern syntax but there was something about function that worked better. I forget what. Is there a reason to prefer const here besides shorter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest reverting this to function as it's more consistent with the rest of our code. I think the rule we're using is "top-level exported functions should use function keyword". I'll add that to styleguide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Create manual mock for testing React components This wraps the component with the requisite theme provider. * Convert component to ES6 arrow function * Add tests for <TooltipIconButton> * Refactor to remove redundant inline wrapper * Add internal attribute to support testing * Add missing blank lines after imports * Reorder file context so name of first object corresponds with filename
This PR adds the supporting infrastructure for manual mocking of components, and two tests for .
Small, optional bonus of converting from ES5 function to ES6 fat arrow function.