Selaa lähdekoodia

Checking delete and backspace before/after first letter.

Szymon Kupś 9 vuotta sitten
vanhempi
commit
afc9df4f65
1 muutettua tiedostoa jossa 14 lisäystä ja 0 poistoa
  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 = {