Added tests for handleDisconnect