Skip to content

Commit 94a5fce

Browse files
committed
Use new API in tests
1 parent c922fab commit 94a5fce

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

tests/Styled.elm

+19-24
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ module Styled exposing (all)
44

55
import Css exposing (..)
66
import 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)
88
import Html.Styled.Attributes exposing (class, css, src)
9-
import Html.Styled.Lazy exposing (keyedLazy)
9+
import Html.Styled.Keyed exposing (lazyNode)
1010
import Test exposing (Test, describe)
1111
import Test.Html.Query as Query
1212
import 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

Comments
 (0)