Open rreubenreyes opened 6 years ago
I can take this one! Do you want a PR with ALL inline styles replaced? :) @radotreyes @austintackaberry
@esthercuan yeah, I think it would be best to replace all inline styles. But don't feel pressured to do it all in one PR, definitely feel free to break it up into multiple PRs or keep one big PR as a WIP for a while if you're short on time!
Ill go ahead and take a look at how many inline styles we have and let you know! :)
@radotreyes I have created a PR for this but tests are failing for unrelated issues. :( https://github.com/austintackaberry/ydkjs-exercises/pull/211
@esthercuan Unfortunately, almost all of our tests are shallow renders which means that any time we change the JSX for each component, there is a risk of our tests failing.
Can you fix the tests based on your changes or do you want help?
I tried runing jest -u
to update snapshots but it does not seem to do much. I also pulled master and ran jest, and tests are failing there too .
hmmmm
Yeah, that's expected. They are breaking as a result of changing all the styles from inline to styled components. The components are being shallowly rendered, so if you change a <h3>
to <Header3>
, then the tests don't know that they need to look for <Header3>
instead of <h3>
.
So in order to fix them, you need to change the tests to look for <Header3>
instead of <h3>
Ok, Ill go ahead and fix them :) thanks for the tips!
No problem!
For scalability purposes, especially if we're making significant changes to the design, I think it would be best to avoid inline styling where possible, and instead make style declarations inside our styled components for component-specific styles, or in
App.css
for global rules.