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

24 lines
689 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"
2021-10-29 21:56:54 +03:00
[ TextInput.text identity ]
2020-04-14 00:28:15 +03:00
|> Html.Styled.toUnstyled
|> Query.fromHtml
|> Query.has
[ tag "input"
, id (TextInput.generateId "myLabel")
]
]