Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bosskmk committed Mar 1, 2024
1 parent 5049e4d commit acaf985
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ dependencies:
sdk: flutter
# Follows the intl version included in Flutter.
# https://github.com/flutter/flutter/blob/84a1e904f44f9b0e9c4510138010edcc653163f8/packages/flutter_localizations/pubspec.yaml#L11
intl: ^0.18.0
intl: ^0.19.0
rxdart: ^0.27.7
collection: ^1.17.1
collection: ^1.18.0

dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^5.4.0
build_runner: ^2.4.2
flutter_lints: ^2.0.1
mockito: ^5.4.4
build_runner: ^2.4.8
flutter_lints: ^3.0.1
21 changes: 12 additions & 9 deletions test/src/helper/pluto_key_manager_event_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ void main() {
await buildWidget(tester: tester, callback: callback);

const key = LogicalKeyboardKey.control;
await tester.sendKeyDownEvent(key);
await simulateKeyDownEvent(key);
expect(keyManagerEvent!.isControl, true);
await tester.sendKeyUpEvent(key);
await simulateKeyUpEvent(key);
},
);

Expand All @@ -146,10 +146,11 @@ void main() {
await buildWidget(tester: tester, callback: callback);

const key = LogicalKeyboardKey.control;
await tester.sendKeyDownEvent(key);
await tester.sendKeyUpEvent(LogicalKeyboardKey.keyC);
await simulateKeyDownEvent(key);
await simulateKeyDownEvent(LogicalKeyboardKey.keyC);
expect(keyManagerEvent!.isCtrlC, true);
await tester.sendKeyUpEvent(key);
await simulateKeyUpEvent(LogicalKeyboardKey.keyC);
await simulateKeyUpEvent(key);
},
);

Expand All @@ -159,10 +160,11 @@ void main() {
await buildWidget(tester: tester, callback: callback);

const key = LogicalKeyboardKey.control;
await tester.sendKeyDownEvent(key);
await tester.sendKeyUpEvent(LogicalKeyboardKey.keyV);
await simulateKeyDownEvent(key);
await simulateKeyDownEvent(LogicalKeyboardKey.keyV);
expect(keyManagerEvent!.isCtrlV, true);
await tester.sendKeyUpEvent(key);
await simulateKeyUpEvent(LogicalKeyboardKey.keyV);
await simulateKeyUpEvent(key);
},
);

Expand All @@ -173,8 +175,9 @@ void main() {

const key = LogicalKeyboardKey.control;
await tester.sendKeyDownEvent(key);
await tester.sendKeyUpEvent(LogicalKeyboardKey.keyA);
await tester.sendKeyDownEvent(LogicalKeyboardKey.keyA);
expect(keyManagerEvent!.isCtrlA, true);
await tester.sendKeyUpEvent(LogicalKeyboardKey.keyA);
await tester.sendKeyUpEvent(key);
},
);
Expand Down

0 comments on commit acaf985

Please sign in to comment.