Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzanardo committed Nov 23, 2023
1 parent f0af011 commit deaf117
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/game/components/camera_debugger_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void main() {
expect(finalPosition.x, equals(updatedPosition.x));
});

testWithGame('increases speed when space is pressed', _TestGame.new,
testWithGame('increases speed when M is pressed', _TestGame.new,
(game) async {
final cameraDebugger = CameraDebugger();
await game.ensureAdd(cameraDebugger);
Expand All @@ -169,7 +169,7 @@ void main() {
cameraDebugger.firstChild<KeyboardListenerComponent>()!;

final keyDown = _MockRawKeyDownEvent();
when(() => keyDown.logicalKey).thenReturn(LogicalKeyboardKey.space);
when(() => keyDown.logicalKey).thenReturn(LogicalKeyboardKey.keyM);

controller.onKeyEvent(keyDown, {LogicalKeyboardKey.space});

Expand All @@ -179,9 +179,9 @@ void main() {

// Should not move anymore when the key is released
final keyUp = _MockRawKeyUpEvent();
when(() => keyUp.logicalKey).thenReturn(LogicalKeyboardKey.space);
when(() => keyUp.logicalKey).thenReturn(LogicalKeyboardKey.keyM);

controller.onKeyEvent(keyUp, {LogicalKeyboardKey.space});
controller.onKeyEvent(keyUp, {LogicalKeyboardKey.keyM});
cameraDebugger.update(0.1);

expect(cameraDebugger.speed, equals(300));
Expand Down

0 comments on commit deaf117

Please sign in to comment.