瀏覽代碼

Checking delete and backspace before/after first letter.

Szymon Kupś 9 年之前
父節點
當前提交
afc9df4f65
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      packages/ckeditor5-image/tests/widget/widget.js

+ 14 - 0
packages/ckeditor5-image/tests/widget/widget.js

@@ -338,6 +338,20 @@ describe( 'Widget', () => {
 			'<paragraph>foo[<inline></inline>]bar</paragraph>'
 		);
 
+		test(
+			'should do nothing if selection is placed after first letter - backspace',
+			'<paragraph>a[]</paragraph>',
+			keyCodes.backspace,
+			'<paragraph>a[]</paragraph>'
+		);
+
+		test(
+			'should do nothing if selection is placed before first letter - delete',
+			'<paragraph>[]a</paragraph>',
+			keyCodes.delete,
+			'<paragraph>[]a</paragraph>'
+		);
+
 		it( 'should prevent default behaviour and stop event propagation', () => {
 			const keydownHandler = sinon.spy();
 			const domEventDataMock = {