From 70f2947baf7fe2de79490f266d4e556090bac1cb Mon Sep 17 00:00:00 2001 From: David Fox Date: Sat, 11 Nov 2023 06:46:30 -0800 Subject: [PATCH] Use compact renderer for test --- spec/Clay/MediaSpec.hs | 47 +++++++----------------------------------- 1 file changed, 7 insertions(+), 40 deletions(-) diff --git a/spec/Clay/MediaSpec.hs b/spec/Clay/MediaSpec.hs index 800c5f0..0594402 100644 --- a/spec/Clay/MediaSpec.hs +++ b/spec/Clay/MediaSpec.hs @@ -2,7 +2,7 @@ module Clay.MediaSpec (spec) where -import Clay (Css, em, hidden, pretty, query, renderWith, visible, visibility) +import Clay (compact, Css, em, hidden, opacity, query, renderWith) import Clay.Media import Clay.Render (Config(..)) import Clay.Stylesheet (Feature, keyframes, MediaType) @@ -76,45 +76,12 @@ spec = do describe "keyframes tests" $ do it "keyframes test 1" $ - (renderWith custom [] $ keyframes "blink-animation" [(0, visibility visible), (100, visibility hidden)]) - `shouldBe` (Text.unlines - [ "" - , "@-webkit-keyframes blink-animation", "{" - -- without fix for the rendering of the Clay.Property.Number type: - -- , "Number {unNumber = 0.00000}% ", "{", "visibility:visible;", "}", "" - -- , "Number {unNumber = 100.00000}% ", "{", "visibility:hidden;", "}", "" - , "0% ", "{", "visibility:visible;", "}", "" - , "100% ", "{", "visibility:hidden;", "}", "", "}" - , "" - , "@-moz-keyframes blink-animation", "{" - , "0% ", "{", "visibility:visible;", "}", "" - , "100% ", "{", "visibility:hidden;", "}", "", "}" - , "" - , "@-ms-keyframes blink-animation", "{" - , "0% ", "{", "visibility:visible;", "}", "" - , "100% ", "{", "visibility:hidden;", "}", "", "}" - , "" - , "@-o-keyframes blink-animation", "{" - , "0% ", "{", "visibility:visible;", "}", "" - , "100% ", "{", "visibility:hidden;", "}", "", "}" - , "" - , "@keyframes blink-animation", "{" - , "0% ", "{", "visibility:visible;", "}", "" - , "100% ", "{", "visibility:hidden;", "}", "", "}" - , ""]) - -custom = - pretty - { - indentation = "" - -- newline = "\n" - , sep = "" - -- , finalSemicolon = True -- False - , warn = False - , align = False - , banner = False - , comments = False - } + (renderWith compact [] $ keyframes "blink-animation" [(0, opacity 0), (100, opacity 1)]) + `shouldBe` ("@-webkit-keyframes blink-animation{0% {opacity:0}100% {opacity:1}}" <> + "@-moz-keyframes blink-animation{0% {opacity:0}100% {opacity:1}}" <> + "@-ms-keyframes blink-animation{0% {opacity:0}100% {opacity:1}}" <> + "@-o-keyframes blink-animation{0% {opacity:0}100% {opacity:1}}" <> + "@keyframes blink-animation{0% {opacity:0}100% {opacity:1}}") -- | Empty CSS for when CSS is needed but we don't care about it. emptyStyle :: Css