vanilla-framework-react icon indicating copy to clipboard operation
vanilla-framework-react copied to clipboard

Reduce the amount of snapshot tests

Open Caleb-Ellis opened this issue 7 years ago • 0 comments

While updating the components to use Vanilla 1.8.0 styling/markup (from 1.6.6) I found that pretty much every component that changed had their tests fail. This was due to the tests being very tightly coupled with the markup (almost 1:1 coupling in fact) meaning that the tests are extremely brittle. I think we should reduce the amount of snapshot tests considerably, in favour of simpler unit tests.

As an example, currently one of the MediaObject tests checks if the large prop works by snapshotting the markup. It would be much simpler to just check if the relevant class (p-media-object--large) is present, rather than the whole markup structure match the snapshot.

Caleb-Ellis avatar Jul 18 '18 08:07 Caleb-Ellis