From e08ab1fc10b634606d5ca52be6c751223666f46d Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Thu, 5 Jan 2023 09:15:18 +0800 Subject: [PATCH] fix: Presses shift + alt + arrow right to select a word --- .../arrow_keys_handler_test.dart | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/frontend/app_flowy/packages/appflowy_editor/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart b/frontend/app_flowy/packages/appflowy_editor/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart index 5772f69e7e..fea6209713 100644 --- a/frontend/app_flowy/packages/appflowy_editor/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart +++ b/frontend/app_flowy/packages/appflowy_editor/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart @@ -402,7 +402,7 @@ void main() async { ); }); - testWidgets('Presses shift + alt + arrow left to select a word', + testWidgets('Presses shift + alt + arrow right to select a word', (tester) async { const text = 'Welcome to Appflowy 😁'; final editor = tester.editor @@ -416,6 +416,18 @@ void main() async { isShiftPressed: true, isAltPressed: true, ); + // < > + expect( + editor.documentSelection, + selection.copyWith( + end: Position(path: [0], offset: 11), + ), + ); + await editor.pressLogicKey( + LogicalKeyboardKey.arrowRight, + isShiftPressed: true, + isAltPressed: true, + ); // < Appflowy> expect( editor.documentSelection, @@ -428,6 +440,11 @@ void main() async { isShiftPressed: true, isAltPressed: true, ); + await editor.pressLogicKey( + LogicalKeyboardKey.arrowRight, + isShiftPressed: true, + isAltPressed: true, + ); // < Appflowy 😁> expect( editor.documentSelection,