Week Log 2
A project journal
🎨 Enzyme specs
2nd December 2020
Today I continued tackling the remaining issues to tidy up my home page. There's a bug where hidden projects and their entries are displayed. I'm currently using this feature to hide the Test Project
, so it'd make things neater to get it working.
I decided to approach this with TDD and write a failing spec for the data obfuscation process before fixing it. And to make that code more easily testable it really needed to be extracted to its own file. To do the extraction I wanted some end-to-end tests around the data loading process to make sure I didn't break it along the way.
So I spent the majority of the day a few steps removed from the original problem: getting enzyme up and running, learning how it interacts with useEffect()
and mocking out axios
with the seed data. It's all a bit of a tangent, but it should lay out the patterns for testing anything else we need to along the way.