From fc6cf001399cda9e1eddf9c3cbf0a55b2f07bd36 Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Mon, 18 Apr 2022 19:11:02 -0700 Subject: [PATCH] Fix tests --- styleguide-app/Examples/Switch.elm | 2 -- styleguide/tests/SwitchExampleSpec.elm | 17 +++++------------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/styleguide-app/Examples/Switch.elm b/styleguide-app/Examples/Switch.elm index fbeb2333..9fc3c05a 100644 --- a/styleguide-app/Examples/Switch.elm +++ b/styleguide-app/Examples/Switch.elm @@ -13,9 +13,7 @@ import Debug.Control as Control exposing (Control) import Debug.Control.Extra as ControlExtra import Debug.Control.View as ControlView import Example exposing (Example) -import Html.Styled as Html import KeyboardSupport exposing (Key(..)) -import Nri.Ui.Heading.V2 as Heading import Nri.Ui.Switch.V2 as Switch diff --git a/styleguide/tests/SwitchExampleSpec.elm b/styleguide/tests/SwitchExampleSpec.elm index fb28f262..ea58696d 100644 --- a/styleguide/tests/SwitchExampleSpec.elm +++ b/styleguide/tests/SwitchExampleSpec.elm @@ -1,6 +1,5 @@ module SwitchExampleSpec exposing (suite) -import Accessibility.Aria as Aria import ProgramTest exposing (..) import Routes exposing (Route) import Test exposing (..) @@ -20,17 +19,11 @@ suite = \() -> app route |> ensureViewHas [ text "Nri.Ui.Switch" ] - -- switch starts with aria-checked=true and text "On" - |> ensureViewHas - [ attribute (Aria.checked (Just True)) - , text "On" - ] + -- switch starts with checked=true + |> ensureViewHas [ checked True ] -- user can click the first switch - |> check "switch-interactive" "On" False - -- the switch now has aria-checked=false and text "Off" - |> ensureViewHas - [ attribute (Aria.checked (Just False)) - , text "Off" - ] + |> check "view-switch-example" "Show pandas in results" False + -- the switch now has checked=false + |> ensureViewHas [ checked False ] |> done ]