diff --git a/src/Mtlstats/Actions.hs b/src/Mtlstats/Actions.hs index def83fd..e3948ea 100644 --- a/src/Mtlstats/Actions.hs +++ b/src/Mtlstats/Actions.hs @@ -100,7 +100,7 @@ createGoalie = let -- | Launches the edit menu edit :: ProgState -> ProgState -edit = undefined +edit = progMode .~ EditMenu -- | Starts the player editing process editPlayer :: ProgState -> ProgState diff --git a/test/ActionsSpec.hs b/test/ActionsSpec.hs index 8f6b764..0f6e1d9 100644 --- a/test/ActionsSpec.hs +++ b/test/ActionsSpec.hs @@ -52,6 +52,7 @@ spec = describe "Mtlstats.Actions" $ do removeCharSpec createPlayerSpec createGoalieSpec + editSpec editPlayerSpec editGoalieSpec addPlayerSpec @@ -198,6 +199,12 @@ createGoalieSpec = describe "createGoalie" $ s = createGoalie newProgState in show (s^.progMode) `shouldBe` "CreateGoalie" +editSpec :: Spec +editSpec = describe "edit" $ + it "should change the mode to EditMenu" $ let + ps = edit newProgState + in show (ps^.progMode) `shouldBe` "EditMenu" + editPlayerSpec :: Spec editPlayerSpec = describe "editPlayer" $ it "should change the mode appropriately" $ let