Explorar o código

Add test for multi range selection.

Maciej Gołaszewski %!s(int64=6) %!d(string=hai) anos
pai
achega
84c6b72288

+ 17 - 0
packages/ckeditor5-restricted-editing/tests/restrictededitingediting.js

@@ -371,6 +371,23 @@ describe( 'RestrictedEditingEditing', () => {
 
 					expect( editor.commands.get( commandName ).isEnabled ).to.be.true;
 				} );
+
+				it( 'should be disabled for non-collapsed selection with more then one range', () => {
+					model.change( writer => {
+						writer.setSelection( [
+							writer.createRange(
+								writer.createPositionAt( firstParagraph, 5 ),
+								writer.createPositionAt( firstParagraph, 6 )
+							),
+							writer.createRange(
+								writer.createPositionAt( firstParagraph, 8 ),
+								writer.createPositionAt( firstParagraph, 9 )
+							)
+						] );
+					} );
+
+					expect( editor.commands.get( commandName ).isEnabled ).to.be.false;
+				} );
 			} );
 		}