Update tests

This commit is contained in:
2026-09-30 15:01:17 +03:00
parent cceddad037
commit 6bcab1a0d8
5 changed files with 42 additions and 27 deletions
+7 -7
View File
@@ -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, object, (.=))
import Data.Aeson (Value)
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` [activateSceneWith "scene.makuuhuone_masse" (Just $ object ["transition" .= (1 :: Int)])]
`shouldContain` [activateScene "scene.makuuhuone_masse"]
it "Masse double click turns on the middle scene" $
concat (services (runHASS bedroomButtonController [masseButton "1_double_press"]))
`shouldContain` [activateSceneWith "scene.makuuhuone_keski" (Just $ object ["transition" .= (1 :: Int)])]
`shouldContain` [activateScene "scene.makuuhuone_keski"]
it "Masse long click turns on the bright scene" $
concat (services (runHASS bedroomButtonController [masseButton "1_long_press"]))
`shouldContain` [activateSceneWith "scene.makuuhuone_kirkas" (Just $ object ["transition" .= (1 :: Int)])]
`shouldContain` [activateScene "scene.makuuhuone_kirkas"]
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` [activateSceneWith "scene.makuuhuone_jemina" (Just $ object ["transition" .= (1 :: Int)])]
`shouldContain` [activateScene "scene.makuuhuone_jemina"]
it "Enishen double click turns on the middle scene" $
concat (services (runHASS bedroomButtonController [enishenButton "1_double_press"]))
`shouldContain` [activateSceneWith "scene.makuuhuone_keski" (Just $ object ["transition" .= (1 :: Int)])]
`shouldContain` [activateScene "scene.makuuhuone_keski"]
it "Enishen long click turns on the bright scene" $
concat (services (runHASS bedroomButtonController [enishenButton "1_long_press"]))
`shouldContain` [activateSceneWith "scene.makuuhuone_kirkas" (Just $ object ["transition" .= (1 :: Int)])]
`shouldContain` [activateScene "scene.makuuhuone_kirkas"]
it "Enishen off click turns the bedroom lights off" $
concat (services (runHASS bedroomButtonController [enishenButton "2_short_release"]))