|
|
@@ -10,7 +10,7 @@ import { injectSelectionPostFixer } from '../../../src/model/utils/selection-pos
|
|
|
import { getData as getModelData, setData as setModelData } from '../../../src/dev-utils/model';
|
|
|
import { assertEqualMarkup } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
|
|
|
|
|
|
-describe.only( 'Selection post-fixer', () => {
|
|
|
+describe( 'Selection post-fixer', () => {
|
|
|
describe( 'injectSelectionPostFixer()', () => {
|
|
|
it( 'is a function', () => {
|
|
|
expect( injectSelectionPostFixer ).to.be.a( 'function' );
|
|
|
@@ -707,6 +707,50 @@ describe.only( 'Selection post-fixer', () => {
|
|
|
'</table>'
|
|
|
);
|
|
|
} );
|
|
|
+
|
|
|
+ it( 'should fix partially wrong selection (last range is post-fixed on whole table)', () => {
|
|
|
+ setModelData( model,
|
|
|
+ '<table>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '[<tableCell><paragraph>aaa</paragraph></tableCell>]' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '[<tableCell><paragraph>ccc</paragraph></tableCell>' +
|
|
|
+ '</tableRow>]' +
|
|
|
+ '</table>'
|
|
|
+ );
|
|
|
+
|
|
|
+ assertEqualMarkup( getModelData( model ),
|
|
|
+ '[<table>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>ccc</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '</table>]'
|
|
|
+ );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'should fix partially wrong selection (first range is post-fixed on whole table)', () => {
|
|
|
+ setModelData( model,
|
|
|
+ '<table>' +
|
|
|
+ '[<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>]' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '[<tableCell><paragraph>ccc</paragraph></tableCell>]' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '</table>'
|
|
|
+ );
|
|
|
+
|
|
|
+ assertEqualMarkup( getModelData( model ),
|
|
|
+ '[<table>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '<tableCell><paragraph>aaa</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>bbb</paragraph></tableCell>' +
|
|
|
+ '<tableCell><paragraph>ccc</paragraph></tableCell>' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '</table>]'
|
|
|
+ );
|
|
|
+ } );
|
|
|
} );
|
|
|
|
|
|
describe( 'non-collapsed selection - image scenarios', () => {
|