avh4 / avh4/elm-program-test

selection radio controls

Open
#116 0 comments 0 reactions 0 assignees View on GitHub
enhancement semver: minor
Dominant language
Elm
Stars
95
Forks
28
PR merge metrics
No merged PRs in 30d

Description

I wrote a little helper to select radio controls in a test I'm writing:

```elm
checkRadio : String -> ProgramTest model msg effect -> ProgramTest model msg effect
checkRadio value =
ProgramTest.simulateDomEvent
(Query.find
[ Selector.tag "input"
, Selector.attribute (Attributes.type_ "radio")
, Selector.attribute (Attributes.value value)
]
)
( "change"
, Encode.object [ ( "target", Encode.object [ ( "checked", Encode.bool True ) ] ) ]
)
```

I went to open a PR here and it looks like there needs to be some more value there around looking in labels. I'm not sure what the right thing to do here is, so… here's the code I have so far! What else would need to happen? Radio buttons seem like an OK thing to add, but is that an OK assumption?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.