should add tests for the other connection events like reconnect etc too.