Skip to content

Commit

Permalink
Test linearGradient2 for correct compilation of AngleOrDirection:
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhallinan authored and Richard Feldman committed Jan 31, 2018
1 parent c4c9238 commit a7a8145
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/Fixtures.elm
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,21 @@ nestedEach =
[ color (hex "FF0000")
]
]


linearGradientWithAngle : Stylesheet
linearGradientWithAngle =
(stylesheet << namespace "linearGradient2Angle")
[ div
[ backgroundImage <| linearGradient2 (deg 10) (stop <| hex "000") (stop <| hex "222") []
]
]


linearGradientWithDirection : Stylesheet
linearGradientWithDirection =
(stylesheet << namespace "linearGradient2Direction")
[ div
[ backgroundImage <| linearGradient2 toBottomLeft (stop <| hex "000") (stop <| hex "222") []
]
]
23 changes: 23 additions & 0 deletions tests/Tests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,29 @@ bug280 =
]


bug335 : Test
bug335 =
let
compiledWithAngle =
prettyPrint Fixtures.linearGradientWithAngle

compiledWithDirection =
prettyPrint Fixtures.linearGradientWithDirection
in
describe "Github Issue #335: https://github.com/rtfeldman/elm-css/issues/335"
[ test "linearGradient2 does not prepend an angle value with the \"to\" keyword." <|
\_ ->
Expect.false
"Expected compiled angle not to include \"to\""
(String.contains "to" compiledWithAngle)
, test "linearGradient2 prepend a direction value with the \"to\" keyword." <|
\_ ->
Expect.true
"Expected compiled direction to include \"to\""
(String.contains "to" compiledWithDirection)
]


nestedEach : Test
nestedEach =
let
Expand Down

0 comments on commit a7a8145

Please sign in to comment.