Skip to content

Commit

Permalink
Test: check that getLastTextLine doesnt return text when the selectio…
Browse files Browse the repository at this point in the history
…n is on the element.
  • Loading branch information
mmotyczynska committed May 16, 2023
1 parent 8f03df2 commit 97db70c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/ckeditor5-typing/tests/utils/getlasttextline.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ describe( 'utils', () => {
[ 0, 0 ],
[ 0, 9 ] );
} );

it( 'should return empty string if the range is `on` the element', () => {
setModelData( model, '<paragraph>foobarbaz[]</paragraph>' );

testOutput(
model.createRangeOn( root.getChild( 0 ) ),
'',
[ 1 ],
[ 1 ] );
} );
} );

function testOutput( range1, expectedText, startPath, endPath ) {
Expand Down

0 comments on commit 97db70c

Please sign in to comment.