From f6b5597cc09a8d0e9659c7f2618106769e18c3fe Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 11 Apr 2023 10:01:51 +0800 Subject: [PATCH] chore: Apply suggestions from code review Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com> --- .../arrow_keys_handler_test.dart | 2 +- .../shortcut_event/shortcut_event_test.dart | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart b/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart index 2d1603a19..86619b156 100644 --- a/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart +++ b/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart @@ -190,7 +190,7 @@ void main() async { ); }); - testWidgets('Presses alt + arrow left key, move the cursor one left right', + testWidgets('Presses alt + arrow left key, move the cursor one word left', (tester) async { const text = 'Welcome to Appflowy'; final editor = tester.editor diff --git a/test/service/shortcut_event/shortcut_event_test.dart b/test/service/shortcut_event/shortcut_event_test.dart index c62c6971b..026c3e8c3 100644 --- a/test/service/shortcut_event/shortcut_event_test.dart +++ b/test/service/shortcut_event/shortcut_event_test.dart @@ -261,18 +261,12 @@ void main() async { expect(editor.documentLength, 2); - if (Platform.isMacOS) { - await editor.pressLogicKey( - key: LogicalKeyboardKey.backspace, - isMetaPressed: true, - ); - } else { - await editor.pressLogicKey( - key: LogicalKeyboardKey.backspace, - isControlPressed: true, - isAltPressed: true, - ); - } + await editor.pressLogicKey( + key: LogicalKeyboardKey.backspace, + isMetaPressed: Platform.isMacOS, + isControlPressed: !Platform.isMacOS, + isAltPressed: !Platform.isMacOS, + ); await tester.pumpAndSettle();