test(client): refactor the unit test