implemented editHomeStandings

This commit is contained in:
Jonathan Lamothe
2020-01-16 12:42:33 -05:00
parent 264d9f81e2
commit 49963277be
6 changed files with 75 additions and 28 deletions
+18 -11
View File
@@ -24,20 +24,27 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
module Actions.EditStandingsSpec (spec) where
import Lens.Micro ((^.))
import Test.Hspec (Spec, describe, it, shouldSatisfy)
import Test.Hspec (Spec, describe, it, shouldBe, shouldSatisfy)
import Mtlstats.Actions.EditStandings
import Mtlstats.Types
spec :: Spec
spec = describe "EditStandings"
editStandingsSpec
spec = describe "EditStandings" $ mapM_
(\(label, f, expected) -> describe label $ do
let
ps = newProgState
ps' = f ps
editStandingsSpec :: Spec
editStandingsSpec = describe "editStandings" $ let
ps = newProgState
ps' = editStandings ps
in it "should set progMode to EditStandings" $
ps'^.progMode `shouldSatisfy` \case
EditStandings -> True
_ -> False
it "should set progMode to EditStandings" $
ps'^.progMode `shouldSatisfy` \case
(EditStandings _) -> True
_ -> False
it ("should set editStandingsMode to " ++ show expected) $
ps'^.progMode.editStandingsModeL `shouldBe` expected)
-- label, function, expected mode
[ ( "editStandings", editStandings, ESMMenu )
, ( "editHomeStandings", editHomeStandings, ESMHome )
]