aboutsummaryrefslogtreecommitdiff
path: root/specs/Specs/ViewSpec.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-25 22:49:41 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-25 23:48:32 +0530
commitd9b2256047669b5a5dbac4baec7140f18a5b6eff (patch)
treeb904df2f8b7c41481a2e8f30659474c97e998444 /specs/Specs/ViewSpec.hs
parent83e2570d3c8da9920d66a00c4bdf5650fe1b3336 (diff)
downloadchelleport-d9b2256047669b5a5dbac4baec7140f18a5b6eff.tar.gz
chelleport-d9b2256047669b5a5dbac4baec7140f18a5b6eff.zip
Refactor state update + test fixes
Diffstat (limited to 'specs/Specs/ViewSpec.hs')
-rw-r--r--specs/Specs/ViewSpec.hs22
1 files changed, 11 insertions, 11 deletions
diff --git a/specs/Specs/ViewSpec.hs b/specs/Specs/ViewSpec.hs
index 39e7fea..1e34811 100644
--- a/specs/Specs/ViewSpec.hs
+++ b/specs/Specs/ViewSpec.hs
@@ -18,10 +18,10 @@ test = do
it "draws matching text labels" $ do
(_, mock) <- runWithMocks $ render currentState
drawTextCalls mock
- `shouldBe` [ Mock_drawText (460, 10) colorWhite "ABC",
- Mock_drawText (1420, 10) colorWhite "DEF",
- Mock_drawText (460, 550) colorWhite "DJK",
- Mock_drawText (1420, 550) colorWhite "JKL"
+ `shouldBe` [ Mock_drawText (460, 10) colorWhite FontLG "ABC",
+ Mock_drawText (1420, 10) colorWhite FontLG "DEF",
+ Mock_drawText (460, 550) colorWhite FontLG "DJK",
+ Mock_drawText (1420, 550) colorWhite FontLG "JKL"
]
context "when there is a partial match" $ do
@@ -30,10 +30,10 @@ test = do
it "draws matching text labels" $ do
(_, mock) <- runWithMocks $ render currentState
drawTextCalls mock
- `shouldBe` [ Mock_drawText (1420, 10) colorLightGray "D",
- Mock_drawText (1430, 10) colorAccent "EF",
- Mock_drawText (460, 550) colorLightGray "D",
- Mock_drawText (470, 550) colorAccent "JK"
+ `shouldBe` [ Mock_drawText (1420, 10) colorLightGray FontLG "D",
+ Mock_drawText (1430, 10) colorAccent FontLG "EF",
+ Mock_drawText (460, 550) colorLightGray FontLG "D",
+ Mock_drawText (470, 550) colorAccent FontLG "JK"
]
context "when key sequence is complete match" $ do
@@ -41,14 +41,14 @@ test = do
it "draws only the matching label" $ do
(_, mock) <- runWithMocks $ render currentState
- drawTextCalls mock `shouldBe` [Mock_drawText (1420, 10) colorLightGray "DEF"]
+ drawTextCalls mock `shouldBe` [Mock_drawText (1420, 10) colorLightGray FontLG "DEF"]
describe "#renderKeySequence" $ do
context "when there is a partial match" $ do
it "draws the matched section and highlights the remaining characters" $ do
(_, mock) <- runWithMocks $ renderKeySequence "ABC" "ABCDE" (0, 0)
calls mock
- `shouldBe` [Mock_drawText (0, 0) colorLightGray "ABC", Mock_drawText (3 * 10, 0) colorAccent "DE"]
+ `shouldBe` [Mock_drawText (0, 0) colorLightGray FontLG "ABC", Mock_drawText (3 * 10, 0) colorAccent FontLG "DE"]
it "return true as the text is visible" $ do
(isVisible, _) <- runWithMocks $ renderKeySequence "ABC" "ABCDE" (0, 0)
@@ -57,7 +57,7 @@ test = do
context "when there is no input key sequence" $ do
it "draws text as a single chunk" $ do
(_, mock) <- runWithMocks $ renderKeySequence "" "ABCD" (0, 0)
- calls mock `shouldBe` [Mock_drawText (0, 0) colorWhite "ABCD"]
+ calls mock `shouldBe` [Mock_drawText (0, 0) colorWhite FontLG "ABCD"]
it "return true as the text is visible" $ do
(isVisible, _) <- runWithMocks $ renderKeySequence "" "ABCD" (0, 0)