mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
Add tests for pipes
This commit is contained in:
parent
fdc93a71df
commit
7dab184c00
@ -47,4 +47,38 @@ view model =
|
||||
"""
|
||||
|> Review.Test.run (defaults |> withHardcodedKnownClasses [ "known" ] |> rule)
|
||||
|> Review.Test.expectNoErrors
|
||||
, test "should report an error when encountering an unknown CSS class through Html.Attributes.class in <| pipe" <|
|
||||
\() ->
|
||||
"""module A exposing (..)
|
||||
import Html
|
||||
import Html.Attributes as Attr
|
||||
|
||||
view model =
|
||||
Html.span [ Attr.class <| "unknown" ] []
|
||||
"""
|
||||
|> Review.Test.run (rule defaults)
|
||||
|> Review.Test.expectErrors
|
||||
[ Review.Test.error
|
||||
{ message = "Unknown CSS class \"unknown\""
|
||||
, details = [ "I could not find this class in CSS files. Have you made a typo? Here are similarly-named classes: TODO" ]
|
||||
, under = "unknown"
|
||||
}
|
||||
]
|
||||
, test "should report an error when encountering an unknown CSS class through Html.Attributes.class in |> pipe" <|
|
||||
\() ->
|
||||
"""module A exposing (..)
|
||||
import Html
|
||||
import Html.Attributes as Attr
|
||||
|
||||
view model =
|
||||
Html.span [ "unknown" |> Attr.class ] []
|
||||
"""
|
||||
|> Review.Test.run (rule defaults)
|
||||
|> Review.Test.expectErrors
|
||||
[ Review.Test.error
|
||||
{ message = "Unknown CSS class \"unknown\""
|
||||
, details = [ "I could not find this class in CSS files. Have you made a typo? Here are similarly-named classes: TODO" ]
|
||||
, under = "unknown"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user