Idea

Testing a front-end component in a real browser catches interaction defects that a simulated environment lets through

Info

Originally written in French. Translated by AI — the meaning has been preserved, not the prose.

Main idea

Between the unit test, which simulates part of the environment, and the end-to-end journey, which involves the whole application, there is an intermediate level: mounting an isolated front-end component in a real browser, with a tool like Playwright, and observing its actual rendering and interactions.

This level sees what the other two miss. A simulated environment confirms that a button exists in the DOM; it does not see that a CSS rule covers it, makes it unreachable or shifts its clickable area. The full journey would see it, but at a cost and with a level of noise that rule out repeating it component by component.

Testing a button is not verifying that it exists; it is verifying that a user can actually use it.

Why it matters

It corrects misplaced confidence: a green suite of unit tests on an interface says nothing about its usability, because the simulated environment computes neither rendering nor layout.

And it becomes more pressing when components are generated: an agent readily produces a structurally correct component whose defect only shows up at render time.

Nuances and limits

An isolated component is not a component in its page: global style conflicts, interactions between components and real data remain out of reach at this level.

And running in a browser is slower than a simulated test: it should be reserved for behaviors where rendering is part of what must be proven.

Open questions

  • Can an agent that generates a component also write the browser test that proves its usability without reproducing its own blind spots?