I like to build things with code. Im a software engineer based in Berlin, Germany.
First, we need to understand which component we want to apply a good quality of tests and what type of tests we want to cover (e.g: unit tests, integration tests or visual / snapshot tests)
We think about all the possible behaviors of the component and what type of software development process we want for doing them, the mostly used is TDD (Test Driven Development) in frontend
With this software development principle we ensure to write first all the possible tests scenarios for a component
When we do this, we are sure that we need to create the component to start making this tests pass
Create the component thinking on solving all the tests scenarios we planned
With the UI created we start to fix all those red tests