implemented edit

This commit is contained in:
Jonathan Lamothe 2019-12-17 12:16:26 -05:00
parent 9980a095ed
commit a44ecc5e24
2 changed files with 8 additions and 1 deletions

View File

@ -100,7 +100,7 @@ createGoalie = let
-- | Launches the edit menu -- | Launches the edit menu
edit :: ProgState -> ProgState edit :: ProgState -> ProgState
edit = undefined edit = progMode .~ EditMenu
-- | Starts the player editing process -- | Starts the player editing process
editPlayer :: ProgState -> ProgState editPlayer :: ProgState -> ProgState

View File

@ -52,6 +52,7 @@ spec = describe "Mtlstats.Actions" $ do
removeCharSpec removeCharSpec
createPlayerSpec createPlayerSpec
createGoalieSpec createGoalieSpec
editSpec
editPlayerSpec editPlayerSpec
editGoalieSpec editGoalieSpec
addPlayerSpec addPlayerSpec
@ -198,6 +199,12 @@ createGoalieSpec = describe "createGoalie" $
s = createGoalie newProgState s = createGoalie newProgState
in show (s^.progMode) `shouldBe` "CreateGoalie" 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 :: Spec
editPlayerSpec = describe "editPlayer" $ editPlayerSpec = describe "editPlayer" $
it "should change the mode appropriately" $ let it "should change the mode appropriately" $ let