-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Adds Not type class, Fixes #239 --------- Co-authored-by: Manuel Bärenz <[email protected]>
- Loading branch information
Showing
3 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{-# LANGUAGE OverloadedStrings, OverloadedLists, TypeApplications #-} | ||
module Clay.PseudoSpec where | ||
|
||
import Test.Hspec | ||
import Clay | ||
import Common | ||
import Prelude hiding (not, div) | ||
|
||
spec :: Spec | ||
spec = do | ||
describe "not pseudo selector" $ do | ||
describe "applied to a selector" $ do | ||
":not(p){display:none}" `shouldRenderFrom` not p & display none | ||
describe "applied to a refinement" $ do | ||
"input:not(:checked){display:none}" `shouldRenderFrom` input # not checked ? display none | ||
describe "applied to both a selector and a refinement" $ do | ||
":not(#some-input:not(:checked)){display:none}" `shouldRenderFrom` not ("#some-input" # not checked) & display none | ||
describe "applied to a overloaded string" $ do | ||
"#some-input:not(:checked) ~ #some-div > div:not(.test){display:none}" `shouldRenderFrom` "#some-input" # not checked |~ "#some-div" |> div # not @Clay.Selector ".test" ? display none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters