         expect(annotation.text).to.equal("a")
         expect(annotation.commentUrl).to.equal("1")
         expect(annotation.page).to.equal("http://page")
-        expect(annotation.ranges).to.eql([])
+        expect(annotation.ranges).to.eql([xpath])
       promise.done.args[0][0]([{content: "a", uri: "1"}, {content: "b", uri: "2"}])
 
     it "should call reject immediately if parsing fails", ->

    annotation =
      id: 1
      page: "http://page"
      ranges: []
      text: "This is an annotation comment"
      quote: "some highlighted text"


      expect(parsed).to.eql(dog: "woof", cat: "meow")

  describe "#highlightFromAnnotation()", ->
    beforeEach ->
      sinon.stub(utils, 'postText').returns('post')
      sinon.stub(utils, 'preText').returns('pre')

    afterEach ->
      utils.postText.restore()
      utils.preText.restore()

    it "should parse the annotation and return a highlight", ->
      target = utils.highlightFromAnnotation(annotation)
      expect(target).to.have.property("locators").to.have.property("pre", "pre")
      expect(target).to.have.property("locators").to.have.property("post", "post")
      expect(target).to.have.property("locators").to.have.property("xpath")
      expect(target).to.have.property("locators").to.have.property("file_id", "http://page")
      expect(target).to.have.property("content", annotation.quote)
      expect(target).to.have.property("id", annotation.id)

