Writing tests for client side code