浏览代码

Tests: tab as safe keycode unit test.

Krzysztof Krztoń 8 年之前
父节点
当前提交
92f9646b5a
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      packages/ckeditor5-typing/tests/input.js

+ 11 - 0
packages/ckeditor5-typing/tests/input.js

@@ -307,6 +307,17 @@ describe( 'Input feature', () => {
 			expect( getModelData( model ) ).to.equal( '<paragraph>fo[ob]ar</paragraph>' );
 		} );
 
+		it( 'should do nothing on tab key', () => {
+			model.enqueueChanges( () => {
+				model.selection.setRanges( [
+					ModelRange.createFromParentsAndOffsets( modelRoot.getChild( 0 ), 2, modelRoot.getChild( 0 ), 4 ) ] );
+			} );
+
+			view.fire( 'keydown', { keyCode: 9 } ); // Tab
+
+			expect( getModelData( model ) ).to.equal( '<paragraph>fo[ob]ar</paragraph>' );
+		} );
+
 		it( 'should do nothing if selection is collapsed', () => {
 			view.fire( 'keydown', { ctrlKey: true, keyCode: getCode( 'c' ) } );