X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/f17e9178a91a7df96fd252f66e058e880eac8932..5c2e36d7dbb5d7437b70183f87fb68ccb6c5d866:/modules/documentCanvas/canvas/canvas.test3.js diff --git a/modules/documentCanvas/canvas/canvas.test3.js b/modules/documentCanvas/canvas/canvas.test3.js index 43c9083..edc81ee 100644 --- a/modules/documentCanvas/canvas/canvas.test3.js +++ b/modules/documentCanvas/canvas/canvas.test3.js @@ -980,6 +980,17 @@ describe('Canvas', function() { expect(cursor.isSelecting()).to.equal(false, 'cursor is not selecting anything'); expect(position.element.getText()).to.equal('Alice has a cat'); expect(position.offset).to.equal(5); + expect(position.offsetAtEnd).to.equal(false, 'offset is not at end'); + + getSelection.returns({ + anchorNode: text, + focusNode: text, + anchorOffset: 15, + focusOffset: 15, + isCollapsed: true + }); + + expect(cursor.getPosition().offsetAtEnd).to.equal(true, 'offset at end'); }); it('returns boundries of selection when browser selection not collapsed', function() {