From 73d4255fd7136fc69f663b4be1785febb0c7706c Mon Sep 17 00:00:00 2001 From: Mats Rauhala Date: Tue, 29 Sep 2026 20:01:03 +0300 Subject: [PATCH] Update tests --- test/BedroomSpec.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/BedroomSpec.hs b/test/BedroomSpec.hs index d9e3ee8..38656ab 100644 --- a/test/BedroomSpec.hs +++ b/test/BedroomSpec.hs @@ -5,7 +5,7 @@ module BedroomSpec (spec) where import AFRP (Event (..), entities) import qualified Data.Set as S import qualified Data.Text as T -import Data.Aeson (Value) +import Data.Aeson (Value, object, (.=)) import HomeAssistant.Controller import HomeAssistant.Controller.Bedroom import Support @@ -91,15 +91,15 @@ buttonSpec = describe "bedroomButtonController" $ do it "Masse single click turns on his nightstand scene (lowest)" $ concat (services (runHASS bedroomButtonController [masseButton "1_short_release"])) - `shouldContain` [activateScene "scene.makuuhuone_masse"] + `shouldContain` [activateSceneWith "scene.makuuhuone_masse" (Just $ object ["transition" .= (5 :: Int)])] it "Masse double click turns on the middle scene" $ concat (services (runHASS bedroomButtonController [masseButton "1_double_press"])) - `shouldContain` [activateScene "scene.makuuhuone_keski"] + `shouldContain` [activateSceneWith "scene.makuuhuone_keski" (Just $ object ["transition" .= (5 :: Int)])] it "Masse long click turns on the bright scene" $ concat (services (runHASS bedroomButtonController [masseButton "1_long_press"])) - `shouldContain` [activateScene "scene.makuuhuone_kirkas"] + `shouldContain` [activateSceneWith "scene.makuuhuone_kirkas" (Just $ object ["transition" .= (5 :: Int)])] it "Masse off click turns the bedroom lights off" $ concat (services (runHASS bedroomButtonController [masseButton "2_short_release"])) @@ -107,15 +107,15 @@ buttonSpec = describe "bedroomButtonController" $ do it "Enishen single click turns on her nightstand scene (lowest)" $ concat (services (runHASS bedroomButtonController [enishenButton "1_short_release"])) - `shouldContain` [activateScene "scene.makuuhuone_jemina"] + `shouldContain` [activateSceneWith "scene.makuuhuone_jemina" (Just $ object ["transition" .= (5 :: Int)])] it "Enishen double click turns on the middle scene" $ concat (services (runHASS bedroomButtonController [enishenButton "1_double_press"])) - `shouldContain` [activateScene "scene.makuuhuone_keski"] + `shouldContain` [activateSceneWith "scene.makuuhuone_keski" (Just $ object ["transition" .= (5 :: Int)])] it "Enishen long click turns on the bright scene" $ concat (services (runHASS bedroomButtonController [enishenButton "1_long_press"])) - `shouldContain` [activateScene "scene.makuuhuone_kirkas"] + `shouldContain` [activateSceneWith "scene.makuuhuone_kirkas" (Just $ object ["transition" .= (5 :: Int)])] it "Enishen off click turns the bedroom lights off" $ concat (services (runHASS bedroomButtonController [enishenButton "2_short_release"]))