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
2021-10-28 02:14:20 +03:00
import Nri.Ui.TextInput.V7 as TextInput
2020-04-14 00:28:15 +03:00
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 =
2021-10-28 02:14:20 +03:00
describe "Nri.Ui.TextInput.V7"
2020-04-14 00:28:15 +03:00
[ 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")
]
]