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
Avatarcomponent.I wasn't sure how to test the
styled-components/styled-systemstyles properly. As you can see we are now checking for3embut 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
urlandnameprops?