mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
Select beginning of end line when offset is 0 on frontend tests
This commit is contained in:
parent
95dc9d0315
commit
3f15ff91eb
2 changed files with 19 additions and 1 deletions
|
@ -158,6 +158,24 @@ describe("the test helper", function(){
|
|||
done();
|
||||
});
|
||||
|
||||
it("ends selection at beginning of $endLine when its offset is zero", function(done){
|
||||
var inner$ = helper.padInner$;
|
||||
|
||||
var startOffset = 2;
|
||||
var endOffset = 0;
|
||||
|
||||
var $lines = inner$("div");
|
||||
var $startLine = $lines.slice(1,2);
|
||||
var $endLine = $lines.slice(3,4);
|
||||
|
||||
helper.selectLines($startLine, $endLine, startOffset, endOffset);
|
||||
|
||||
var selection = inner$.document.getSelection();
|
||||
expect(cleanText(selection.toString())).to.be("ort \nlines \n");
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it("selects full line when offset is longer than line content", function(done){
|
||||
var inner$ = helper.padInner$;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue