|
|
@@ -124,6 +124,28 @@ describe( 'table clipboard', () => {
|
|
|
] ) );
|
|
|
} );
|
|
|
|
|
|
+ it( 'should not alter model.insertContent if no table pasted', () => {
|
|
|
+ tableSelection.setCellSelection(
|
|
|
+ modelRoot.getNodeByPath( [ 0, 0, 0 ] ),
|
|
|
+ modelRoot.getNodeByPath( [ 0, 1, 1 ] )
|
|
|
+ );
|
|
|
+
|
|
|
+ const data = {
|
|
|
+ dataTransfer: createDataTransfer(),
|
|
|
+ preventDefault: sinon.spy(),
|
|
|
+ stopPropagation: sinon.spy()
|
|
|
+ };
|
|
|
+ data.dataTransfer.setData( 'text/html', '<p>foo</p>' );
|
|
|
+ viewDocument.fire( 'paste', data );
|
|
|
+
|
|
|
+ assertEqualMarkup( getModelData( model, { withoutSelection: true } ), modelTable( [
|
|
|
+ [ 'foo', '', '02', '03' ],
|
|
|
+ [ '', '', '12', '13' ],
|
|
|
+ [ '20', '21', '22', '23' ],
|
|
|
+ [ '30', '31', '32', '33' ]
|
|
|
+ ] ) );
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'should not alter model.insertContent if mixed content is pasted (table + paragraph)', () => {
|
|
|
tableSelection.setCellSelection(
|
|
|
modelRoot.getNodeByPath( [ 0, 0, 0 ] ),
|