xhr unit test