From 7083855bc0a5996936547ea4b4e5c65e0853aae9 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Fri, 12 Jul 2019 17:14:47 +1200 Subject: [PATCH] Test override styles. --- test/Test.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/Test.hs b/test/Test.hs index 4697959..a6e21d8 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -260,6 +260,16 @@ spec = do let rules2 = parse (rules {priority = 2}) "a {color: green !important}" :: QueryableStyleSheet TrivialPropertyParser let TrivialPropertyParser style = cascade rules2 el [] temp::TrivialPropertyParser style ! "color" `shouldBe` [Ident "green"] + it "respects overrides" $ do + let el = ElementNode { + name = "a", + parent = Nothing, + previous = Nothing, + attributes = [Attribute "class" "link"] + } + let rules = parse queryable "a {color: red;}" + let TrivialPropertyParser style = cascade rules el [("color", [Ident "green"])] temp::TrivialPropertyParser + style ! "color" `shouldBe` [Ident "green"] styleIndex :: StyleIndex styleIndex = new -- 2.30.2