Fix tests

This commit is contained in:
Tessa Kelly 2022-04-18 19:11:02 -07:00
parent 1b5a92867e
commit fc6cf00139
2 changed files with 5 additions and 14 deletions

View File

@ -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

View File

@ -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
]