Testing disconnect of socket/channel


I’m new to Elixir and Phoenix. In my first “real” project I’ve got user sessions (GenServers) that eventually might time out. When they do, they send


to remove all associated sockets/channels. Now, I’d like to integration test this together with some of my channels. But when I start a test socket and channel via Phoenix.ChannelTest, I don’t see any effect. I understand that this looks a bit like I want to test Phoenix itself. But my minimal test should tie UserSocket.id/1 to this broadcast in my session GenServer to have it fail if I ever change only one side.

What’s the supposed, idiomatic way to integration test this?