Many UI teams are making a fundamental mistake: They’re not using mocks...


Many UI teams are making a fundamental mistake: They’re not using mocks effectively.

The solution? Mock Driven Development.™️

1. *Before* coding, look at the UI design and ask: “What mock responses do I need to fully exercise this feature?” What edge cases are in the real data? What potential HTTP status codes may I receive? What if the user doesn’t have access? What if there is no data? What if the response is slow? What if an error occurs?

2. Create mock responses for these scenarios. Configure a mocking tool like @ApiMocking to return them.

3. Implement automated tests that assure the UI works as expected with these mocked scenarios. I typically use @playwrightweb or @Cypress_io.

View original on X