@@ -4,7 +4,7 @@ module Styled exposing (all)
4
4
5
5
import Css exposing (..)
6
6
import Html.Styled exposing (Html , a , button , div , header , img , nav , text , toUnstyled )
7
- import Html.Styled.Attributes exposing (css , src )
7
+ import Html.Styled.Attributes exposing (class , css , src )
8
8
import Test exposing (Test , describe )
9
9
import Test.Html.Query as Query
10
10
import Test.Html.Selector as Selector
@@ -107,4 +107,37 @@ all =
107
107
, Selector . text " ._20d887e{padding:16px;padding-left:24px;padding-right:24px;margin-left:50px;margin-right:auto;color:rgb(255,255,255);background-color:rgb(27,217,130);vertical-align:middle;}"
108
108
]
109
109
)
110
+ , bug564
111
+ ]
112
+
113
+
114
+ bug564 : Test
115
+ bug564 =
116
+ describe " Github Issue #564: https://github.com/rtfeldman/elm-css/issues/564"
117
+ [ Test . test " generated class is included when there's no custom class" <|
118
+ \ _ ->
119
+ div
120
+ [ css [ color ( rgb 0 0 0 ) ]
121
+ ]
122
+ []
123
+ |> toUnstyled
124
+ |> Query . fromHtml
125
+ |> Query . has [ Selector . class " _5dc67897" ]
126
+ , Test . test " custom class is included when there's no generated class" <|
127
+ \ _ ->
128
+ div [ class " some-custom-class" ]
129
+ []
130
+ |> toUnstyled
131
+ |> Query . fromHtml
132
+ |> Query . has [ Selector . class " some-custom-class" ]
133
+ , Test . test " custom class is included as well as generated class" <|
134
+ \ _ ->
135
+ div
136
+ [ css [ color ( rgb 0 0 0 ) ]
137
+ , class " some-custom-class"
138
+ ]
139
+ []
140
+ |> toUnstyled
141
+ |> Query . fromHtml
142
+ |> Query . has [ Selector . classes [ " _5dc67897" , " some-custom-class" ] ]
110
143
]
0 commit comments