try another attribute so aria isn't mad

This commit is contained in:
Katie Hughes 2019-09-16 14:51:24 -07:00
parent e1b951d7f2
commit 0737af2649
2 changed files with 5 additions and 3 deletions

View File

@ -9,6 +9,7 @@ module Nri.Ui.SegmentedControl.V7 exposing (Config, Icon, Option, Width(..), vie
import Accessibility.Styled exposing (..)
import Accessibility.Styled.Aria as Aria
import Accessibility.Styled.Role as Role
import Accessibility.Styled.Widget as Widget
import Css exposing (..)
import EventExtras.Styled as EventExtras
import Html.Styled as Html exposing (Html)
@ -181,7 +182,7 @@ viewTab maybeToUrl forPage config option =
Aria.currentPage
else
Aria.currentItem True
Widget.selected True
in
element
(List.concat

View File

@ -1,6 +1,7 @@
module Spec.Nri.Ui.SegmentedControl.V7 exposing (spec)
import Accessibility.Aria as Aria
import Accessibility.Widget as Widget
import Expect
import Html.Attributes
import Html.Styled
@ -45,14 +46,14 @@ spec =
}
|> Query.findAll [ Selector.attribute (Aria.controls "Nri-Ui-SegmentedControl-Panel-a-label") ]
|> Query.index 1
|> Query.has [ Selector.attribute (Aria.currentItem True) ]
|> Query.has [ Selector.attribute (Widget.selected True) ]
, test "always has one item selected" <|
\() ->
toggleView
{ options = [ 1, 2, 3 ]
, selected = 2
}
|> Query.findAll [ Selector.attribute (Aria.currentItem True) ]
|> Query.findAll [ Selector.attribute (Widget.selected True) ]
|> Query.count (Expect.equal 1)
]
]