mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-24 06:02:36 +03:00
try another attribute so aria isn't mad
This commit is contained in:
parent
e1b951d7f2
commit
0737af2649
@ -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
|
||||
|
@ -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)
|
||||
]
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user