Add tests for xhr wrapper