add test cases for connect