Do unit tests completely miss routing and browser history bugs for you too?

by•

It’s funny how all our automated tests can pass with 100% green checks and yet a simple user action like hitting the browser's Back arrow completely breaks the app experience.

I spent hours debugging why an onboarding wizard kept dragging finished users backward because of how router pushes stack up in Next.js. Unit tests just don't catch browser level history states unless you're running heavy end-to-end browser tests.

For UI flows with multiple steps do you rely on tools like Playwright to test history behavior or is this just one of those things you catch manually by testing it yourself?

4 views

Add a comment

Replies

Best

I ended up preventing it by design more than by tests. In my mobile app the whole navigation is one stack held in a single place, and screens can only change it through push, pop or replace all. A finished flow like onboarding or sign in leaves with replace all, so there is simply no previous screen for back to land on. Root screens also get a page type without the swipe back gesture, while pushed screens get it. Then a few end to end scenarios that drive the real app on an emulator cover the flows that matter. Deciding per screen whether back should exist at all catches more than any test written afterwards.