From 6ad789149036a9e97a9c66860828892efa432bd4 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 26 Dec 2024 00:17:53 +0530 Subject: Add c-hjkl for movement keys --- specs/Specs/AppStateSpec.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'specs') diff --git a/specs/Specs/AppStateSpec.hs b/specs/Specs/AppStateSpec.hs index eb5ab1b..7eeb082 100644 --- a/specs/Specs/AppStateSpec.hs +++ b/specs/Specs/AppStateSpec.hs @@ -175,6 +175,26 @@ test = do ((_, action), _) <- runWithMocks $ update currentState $ HandleKeyInput SDL.KeycodeF action `shouldBe` Just (MoveMousePosition (1640, 370)) + context "with action MoveMouseInDirection" $ do + let currentState = defaultState + + context "when direction is up" $ do + it "continues to increment movement" $ do + ((_, action), _) <- runWithMocks $ update currentState $ MoveMouseInDirection DirUp + action `shouldBe` Just (IncrementMouseCursor (0, -33)) + context "when direction is down" $ do + it "continues to increment movement" $ do + ((_, action), _) <- runWithMocks $ update currentState $ MoveMouseInDirection DirDown + action `shouldBe` Just (IncrementMouseCursor (0, 33)) + context "when direction is left" $ do + it "continues to increment movement" $ do + ((_, action), _) <- runWithMocks $ update currentState $ MoveMouseInDirection DirLeft + action `shouldBe` Just (IncrementMouseCursor (-60, 0)) + context "when direction is right" $ do + it "continues to increment movement" $ do + ((_, action), _) <- runWithMocks $ update currentState $ MoveMouseInDirection DirRight + action `shouldBe` Just (IncrementMouseCursor (60, 0)) + context "with action MoveMousePosition" $ do let currentState = defaultState -- cgit v1.3.1