fix return Pending Promise
add return Promise test case and fix test cases