The hidden cost of putting inboxes in component state
Email verification looks like a small UI feature: render an address, wait for a message, show a success state. In a real React application, it quickly becomes a coordination problem. The component knows about polling, expiration, message parsing, retry timing, and cleanup. A test then needs to reproduce an entire inbox just to check whether a button is enabled.
That is a signal that the email fixture has crossed the wrong boundary.
In projects I work on, I get more reliable tests by treating a disposable inbox as an external test dependency. React receives a small, typed result. The test owns the fixture lifecycle. The component only owns the user experience. This separation makes the happy path fast and makes failure states much less mysterious.
It also avoids confusing search terms with architecture.…