@@ -4,9 +4,9 @@ module Styled exposing (all)
44
55import Css exposing (..)
66import Css.Media as Media
7- import Html.Styled exposing (Html , a , button , div , header , img , nav , text , toUnstyled )
7+ import Html.Styled exposing (Html , a , button , div , header , img , li , nav , text , toUnstyled )
88import Html.Styled.Attributes exposing (class , css , src )
9- import Html.Styled.Lazy exposing (keyedLazy )
9+ import Html.Styled.Keyed exposing (lazyNode )
1010import Test exposing (Test , describe )
1111import Test.Html.Query as Query
1212import Test.Html.Selector as Selector
@@ -151,41 +151,36 @@ keyedLazyTests =
151151 describe " keyedLazy"
152152 [ Test . test " generates an appropriate selector for the root node" <|
153153 \ _ ->
154- keyedLazy
155- ( \ i ->
156- ( " item-" ++ String . fromInt i
157- , div [ css [ color ( rgb 0 0 0 ) ] ] []
158- )
154+ lazyNode " ul"
155+ []
156+ ( \ _ ->
157+ div [ css [ color ( rgb 0 0 0 ) ] ] []
159158 )
160- 1
159+ [ ( " item-1 " , 1 ) ]
161160 |> toUnstyled
162161 |> Query . fromHtml
163162 |> Query . has [ Selector . text " #item-1._5dc67897" ]
164163 , Test . test " generates an appropriate selector for a descendant node" <|
165164 \ _ ->
166- keyedLazy
167- ( \ i ->
168- ( " item-" ++ String . fromInt i
169- , div []
170- [ div [ css [ color ( rgb 0 0 0 ) ] ] []
171- ]
172- )
165+ lazyNode
166+ " ul"
167+ []
168+ ( \ _ ->
169+ li [] [ div [ css [ color ( rgb 0 0 0 ) ] ] [] ]
173170 )
174- 1
171+ [ ( " item-1 " , 1 ) ]
175172 |> toUnstyled
176173 |> Query . fromHtml
177174 |> Query . has [ Selector . text " #item-1 ._5dc67897" ]
178175 , Test . test " generates an appropriate selector with media" <|
179176 \ _ ->
180- keyedLazy
181- ( \ i ->
182- ( " item-" ++ String . fromInt i
183- , div []
184- [ div [ css [ Media . withMedia [ Media . only Media . screen [] ] [ color ( rgb 0 0 0 ) ] ] ] []
185- ]
186- )
177+ lazyNode
178+ " ul"
179+ []
180+ ( \ _ ->
181+ li [] [ div [ css [ Media . withMedia [ Media . only Media . screen [] ] [ color ( rgb 0 0 0 ) ] ] ] [] ]
187182 )
188- 1
183+ [ ( " item-1 " , 1 ) ]
189184 |> toUnstyled
190185 |> Query . fromHtml
191186 |> Query . has [ Selector . text " #item-1 ._22afe2eb" ]
0 commit comments