Refactor client.js test