mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-24 00:42:29 +03:00
Build out Elm test against styleguide app
This commit is contained in:
parent
90310817ca
commit
c0772233bb
@ -45,7 +45,8 @@
|
||||
"test-dependencies": {
|
||||
"direct": {
|
||||
"avh4/elm-program-test": "3.6.3",
|
||||
"elm-explorations/test": "1.2.2"
|
||||
"elm-explorations/test": "1.2.2",
|
||||
"tesk9/accessible-html": "5.0.0"
|
||||
},
|
||||
"indirect": {
|
||||
"avh4/elm-fifo": "1.0.4",
|
||||
|
@ -1,5 +1,6 @@
|
||||
module SwitchExampleSpec exposing (suite)
|
||||
|
||||
import Accessibility.Aria as Aria
|
||||
import ProgramTest exposing (..)
|
||||
import Routes exposing (Route)
|
||||
import Test exposing (..)
|
||||
@ -19,5 +20,17 @@ 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"
|
||||
]
|
||||
-- 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"
|
||||
]
|
||||
|> done
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user