{-# LANGUAGE OverloadedStrings #-} module HttpServerSpec (spec) where import qualified Data.Map.Strict as M import Data.Text (Text) import qualified Data.Text as T import Data.Text.Lazy.Encoding (decodeUtf8) import qualified Data.Text.Lazy as TL import Lucid (Html, renderBS, toHtml) import Test.Hspec import HomeAssistant.Runtime.Graphing (Range (..)) import HttpServer render :: Html () -> String render = TL.unpack . decodeUtf8 . renderBS spec :: Spec spec = describe "HttpServer" $ do describe "flagRow" $ do it "renders the whole row so htmx can outerHTML-swap it" $ render (flagRow "tea" True) `shouldContain` "