mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-18 11:11:38 +03:00
43 lines
1.4 KiB
Elm
43 lines
1.4 KiB
Elm
module Spec.Nri.Ui.DisclosureIndicator.V1 exposing (spec)
|
|
|
|
import Html.Attributes exposing (alt)
|
|
import Html.Styled exposing (div, toUnstyled)
|
|
import Nri.Ui.AssetPath exposing (Asset(..))
|
|
import Nri.Ui.DisclosureIndicator.V1 as DisclosureIndicator
|
|
import Test exposing (..)
|
|
import Test.Html.Query as Query
|
|
import Test.Html.Selector exposing (..)
|
|
|
|
|
|
spec : Test
|
|
spec =
|
|
describe "Nri.Ui.DisclosureIndicator.V1"
|
|
[ test "has accessibility text for closed state" <|
|
|
\() ->
|
|
DisclosureIndicator.view assets
|
|
{ isOpen = False
|
|
, label = "carrots"
|
|
}
|
|
|> (\x -> div [] [ x ])
|
|
|> toUnstyled
|
|
|> Query.fromHtml
|
|
|> Query.find [ tag "img" ]
|
|
|> Query.has [ attribute (alt "show carrots") ]
|
|
, test "has accessibility text for open state" <|
|
|
\() ->
|
|
DisclosureIndicator.view assets
|
|
{ isOpen = True
|
|
, label = "carrots"
|
|
}
|
|
|> (\x -> div [] [ x ])
|
|
|> toUnstyled
|
|
|> Query.fromHtml
|
|
|> Query.find [ tag "img" ]
|
|
|> Query.has [ attribute (alt "hide carrots") ]
|
|
]
|
|
|
|
|
|
assets =
|
|
{ icons_arrowDownBlue_svg = Asset "arrowDownBlue reference"
|
|
}
|