aboutsummaryrefslogtreecommitdiff
path: root/specs/Specs/AppStateSpec.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-26 00:17:53 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-26 00:20:47 +0530
commit6ad789149036a9e97a9c66860828892efa432bd4 (patch)
treeb509812fc69f1af890c1c4ddbcda79f81bc9ab43 /specs/Specs/AppStateSpec.hs
parentd9b2256047669b5a5dbac4baec7140f18a5b6eff (diff)
downloadchelleport-6ad789149036a9e97a9c66860828892efa432bd4.tar.gz
chelleport-6ad789149036a9e97a9c66860828892efa432bd4.zip
Add c-hjkl for movement keys
Diffstat (limited to '')
-rw-r--r--specs/Specs/AppStateSpec.hs20
1 files changed, 20 insertions, 0 deletions
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