Skip to content

Commit

Permalink
Added Browser specific XPaths to Range spec as documents are different
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed Jun 29, 2011
1 parent 6951a66 commit 5d5137a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/spec/range_spec.coffee
Expand Up @@ -59,13 +59,14 @@ describe 'Range', ->
expect(JSON.stringify(obj)).toEqual('{"start":"/p/strong","startOffset":13,"end":"/p/strong","endOffset":27}')

describe "_nodeFromXPath", ->
xpath = if window.require then "/html/body/p/strong" else "/html/body/div/p/strong"
it "should parse a standard xpath string", ->
node = r._nodeFromXPath "/html/body/p/strong"
node = r._nodeFromXPath xpath
expect(node).toBe($('strong')[0])

it "should parse an standard xpath string for an xml document", ->
Annotator.$.isXMLDoc = -> true
node = r._nodeFromXPath "/html/body/p/strong"
node = r._nodeFromXPath xpath
expect(node).toBe($('strong')[0])

describe "BrowserRange", ->
Expand Down

0 comments on commit 5d5137a

Please sign in to comment.