~alcinnz/haskell-stylist

7083855bc0a5996936547ea4b4e5c65e0853aae9 — Adrian Cochrane 5 years ago a35a8a2
Test override styles.
1 files changed, 10 insertions(+), 0 deletions(-)

M test/Test.hs
M test/Test.hs => test/Test.hs +10 -0
@@ 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