3 ms·
There must be something better than loading the whole page, potentially with all sorts of database or network mockery required to provide it with all the data t
by azangru 4y ago
There must be something better than loading the whole page, potentially with all sorts of database or network mockery required to provide it with all the data that it needs for rendering, in order to test how a particular button works. It's no coincidence that the release of Jest and Enzyme around 2015 produced such a huge enthusiasm in the frontend community.
- WorldMaker 4y agoThere's always the "Storybook approach" alternative: make sure all your UI components are individually renderable by pure props and then build standalone from your application story boards around those prop states. I tend to find that more useful for UI testing than unit tests because it gives designers something to critique and often better fits how they want to work. (Versus trying to assert things like specific DIVs exists, which might get rearranged or eliminated in the next design change.) It's easier to storyboard some complex component trees sometimes too.