xhr: Wrote tests for xhr.js

- [ ] @davestein
`rejects promise on xhr failure`