noredink-ui/tests/Spec/Nri/Ui/TextInput.elm

26 lines
733 B
Elm
Raw Normal View History

module Spec.Nri.Ui.TextInput exposing (spec)
2020-04-14 00:28:15 +03:00
import Html.Styled
import Nri.Ui.TextInput.V6 as TextInput
import Test exposing (..)
import Test.Html.Query as Query
import Test.Html.Selector exposing (..)
2020-04-14 00:28:15 +03:00
spec : Test
spec =
2020-04-14 00:28:15 +03:00
describe "Nri.Ui.TextInput.V6"
[ test "it uses the same DOM id that generateId produces" <|
\() ->
TextInput.view "myLabel"
(TextInput.text identity)
[]
""
2020-04-14 00:28:15 +03:00
|> Html.Styled.toUnstyled
|> Query.fromHtml
|> Query.has
[ tag "input"
, id (TextInput.generateId "myLabel")
]
]