diff --git a/test/Fixtures.elm b/test/Fixtures.elm index 9be1111b..db0f64f2 100644 --- a/test/Fixtures.elm +++ b/test/Fixtures.elm @@ -69,6 +69,17 @@ bug99 = ] +bug140 : Stylesheet +bug140 = + stylesheet + [ each [ input, selector "textarea" ] + [ focus + [ borderColor (hex "#000000") + ] + ] + ] + + simpleEach : Stylesheet simpleEach = stylesheet diff --git a/test/Tests.elm b/test/Tests.elm index b53e1205..07a56a1e 100644 --- a/test/Tests.elm +++ b/test/Tests.elm @@ -22,6 +22,7 @@ all = , atRule , nestedAtRule , bug99 + , bug140 , universal , multiSelector , multiDescendent @@ -210,6 +211,28 @@ nestedAtRule = ] +{-| Regression test for https://github.com/rtfeldman/elm-css/issues/140 +-} +bug140 : Test +bug140 = + let + input = + Fixtures.bug140 + + output = + """ +input:focus, textarea:focus { + border-color: #000000; +} """ + in + describe "`each` with pseudo classes" + [ test "pretty prints the expected output" <| + \_ -> + outdented (prettyPrint input) + |> Expect.equal (outdented output) + ] + + {-| Regression test for https://github.com/rtfeldman/elm-css/issues/99 -} bug99 : Test