From 97db70c4fb96a5308a79cd2262198940c1e7acb9 Mon Sep 17 00:00:00 2001 From: Marta Motyczynska Date: Tue, 16 May 2023 13:54:16 +0200 Subject: [PATCH] Test: check that getLastTextLine doesnt return text when the selection is on the element. --- .../ckeditor5-typing/tests/utils/getlasttextline.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/ckeditor5-typing/tests/utils/getlasttextline.js b/packages/ckeditor5-typing/tests/utils/getlasttextline.js index 1ac90133e1c..d5c19a7af1d 100644 --- a/packages/ckeditor5-typing/tests/utils/getlasttextline.js +++ b/packages/ckeditor5-typing/tests/utils/getlasttextline.js @@ -76,6 +76,16 @@ describe( 'utils', () => { [ 0, 0 ], [ 0, 9 ] ); } ); + + it( 'should return empty string if the range is `on` the element', () => { + setModelData( model, 'foobarbaz[]' ); + + testOutput( + model.createRangeOn( root.getChild( 0 ) ), + '', + [ 1 ], + [ 1 ] ); + } ); } ); function testOutput( range1, expectedText, startPath, endPath ) {