Prevent Visual Regressions

If you compose your React applications as we have been doing so far, there’s a clear separation between parts of the application that handle logic and parts that just concern themselves with the UI. Checking that the UI matches expectations is tedious. Even if a component outputs different HTML elements, the visual result might turn out to be identical, so tests that check the generated HTML might break even though the application still displays the expected UI. Although these sort of tests tend to break without good reason, you might not want to skip them completely, as they still can alert you that something is wrong. We’ll compromise and use a solution that will let you write and update tests very fast, so that you ...

Get React for Real now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.