-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add tests #23
base: master
Are you sure you want to change the base?
Add tests #23
Conversation
Hi Sander, Sorry, for my late reply. Let's find a better workflow together. Maybe chat soon to discuss. The tests look good. A couple of small remarks:
Okay, that's my feedback for now. The tests will probably become a lot more interesting, once the components are a bit more challenging. Let's chat soon and discuss a better workflow (and again apologies for my tardiness) JH |
I've revised the previous tests and added tests for Bar and Button components. I found that a common case people tend to test components on, is if they are capable of passing/setting props. But props are not always used 1 on 1 in the component, e.g. you might use the prop to calculate a different value and render that in the component. Also, you can't always pass all props that the component is capable of setting at once. This last scenario happens in the Button component, where you wouldn't pass both an onClick and a href. In the test I've now used a few props to test if the component is capable of setting props:
I'm unsure wether with testing the capability of setting props, we're really just testing if the component can set any prop, or if we're supposed to test the capability of setting each individual prop. |
Set up the testing environment and added first tests for the
Avatar
component.I wasn't sure how to test the
styled-components
/styled-system
styles properly. As you can see we are now checking for3em
but it would be better to do this based on a variable set in the test itself.Should we also be testing for if the component is capable of passing the
url
andname
props?