diff options
| author | Akshay Nair <phenax5@gmail.com> | 2024-12-28 21:36:39 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2024-12-28 21:36:39 +0530 |
| commit | d000cbb52821dc33c5d2f3d676dc6efa54f3b25f (patch) | |
| tree | 7d4d51082b3b7ddf4f3b94879383efb003a87394 /specs/Specs/ViewSpec.hs | |
| parent | b305546950a6742f25023e2ffece423905e1bda8 (diff) | |
| download | chelleport-d000cbb52821dc33c5d2f3d676dc6efa54f3b25f.tar.gz chelleport-d000cbb52821dc33c5d2f3d676dc6efa54f3b25f.zip | |
Move hints mode state inside ModeHints constructor
Diffstat (limited to '')
| -rw-r--r-- | specs/Specs/ViewSpec.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/specs/Specs/ViewSpec.hs b/specs/Specs/ViewSpec.hs index f3cfdf2..a5a67c9 100644 --- a/specs/Specs/ViewSpec.hs +++ b/specs/Specs/ViewSpec.hs @@ -9,11 +9,11 @@ import TestUtils test :: SpecWith () test = do - let defaultState = def {stateGrid = [["ABC", "DEF"], ["DJK", "JKL"]]} + let defaultState = def {stateGridRows = 2, stateGridCols = 2, stateMode = ModeHints def {stateGrid = [["ABC", "DEF"], ["DJK", "JKL"]]}} describe "#render" $ do context "when key sequence is empty" $ do - let currentState = defaultState {stateKeySequence = ""} + let currentState = defaultState {stateMode = ModeHints (modeHintsData $ stateMode defaultState) {stateKeySequence = ""}} it "draws matching text labels" $ do (_, mock) <- runWithMocks $ do @@ -25,7 +25,7 @@ test = do mock `shouldHaveCalled` Mock_drawText (1420, 550) colorWhite FontLG "JKL" context "when there is a partial match" $ do - let currentState = defaultState {stateKeySequence = "D"} + let currentState = defaultState {stateMode = ModeHints (modeHintsData $ stateMode defaultState) {stateKeySequence = "D"}} it "draws matching text labels" $ do (_, mock) <- runWithMocks $ do @@ -39,7 +39,7 @@ test = do mock `shouldHaveCalled` Mock_drawText (470, 550) colorAccent FontLG "JK" context "when key sequence is complete match" $ do - let currentState = defaultState {stateKeySequence = "DEF"} + let currentState = defaultState {stateMode = ModeHints (modeHintsData $ stateMode defaultState) {stateKeySequence = "DEF"}} it "draws only the matching label" $ do (_, mock) <- runWithMocks $ do |
