@@ -4,9 +4,9 @@ module Styled exposing (all)
4
4
5
5
import Css exposing (..)
6
6
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 )
8
8
import Html.Styled.Attributes exposing (class , css , src )
9
- import Html.Styled.Lazy exposing (keyedLazy )
9
+ import Html.Styled.Keyed exposing (lazyNode )
10
10
import Test exposing (Test , describe )
11
11
import Test.Html.Query as Query
12
12
import Test.Html.Selector as Selector
@@ -151,41 +151,36 @@ keyedLazyTests =
151
151
describe " keyedLazy"
152
152
[ Test . test " generates an appropriate selector for the root node" <|
153
153
\ _ ->
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 ) ] ] []
159
158
)
160
- 1
159
+ [ ( " item-1 " , 1 ) ]
161
160
|> toUnstyled
162
161
|> Query . fromHtml
163
162
|> Query . has [ Selector . text " #item-1._5dc67897" ]
164
163
, Test . test " generates an appropriate selector for a descendant node" <|
165
164
\ _ ->
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 ) ] ] [] ]
173
170
)
174
- 1
171
+ [ ( " item-1 " , 1 ) ]
175
172
|> toUnstyled
176
173
|> Query . fromHtml
177
174
|> Query . has [ Selector . text " #item-1 ._5dc67897" ]
178
175
, Test . test " generates an appropriate selector with media" <|
179
176
\ _ ->
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 ) ] ] ] [] ]
187
182
)
188
- 1
183
+ [ ( " item-1 " , 1 ) ]
189
184
|> toUnstyled
190
185
|> Query . fromHtml
191
186
|> Query . has [ Selector . text " #item-1 ._22afe2eb" ]
0 commit comments