Context: Fullstack program which implements reconnection logic that utilizes TTL session expiries that are managed on the backend to determine whether or not a session is "still open to rejoin".
This is a genuine e2e journey that matters in production and is deserving of browser coverage; however, I'm still uncertain about whether wiring a bunch of test-endpoints and hiding them behind a test-only flag is "good practice" or not.
An example usage would be an endpoint to delete a running session. Currently, I can't see a good reason to have this kind of endpoint in my particular project, but it would be needed to verify how the client reacts to a genuine reconnect to a recently deleted session (routing, prompts, socket cleanup, etc). It's already unit/integration tested using mocks, but shoudn't it have an e2e journey as well?
I've never worked in a dev team before, so do many teams run e2e suites against “prod-like” environments that expose test-only backend controls? For some reason it doesn't feel like the perfect solution, but I can't think of anything cleaner.