eeue56 / eeue56/elm-html-test

Have a way to get the options that the handler for a simulated event set

Open
#63 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Elm
Stars
68
Forks
15
PR merge metrics
No merged PRs in 30d

Description

I am adding functions in avh4/elm-program-test to help verify correct implementation of links in single-page apps. To do this correctly, I need a way to test whether the onClick handler of a found node is setting the `preventDefault` option.

This could possibly be done by changing `toResult` to:

```elm
toResult : Event msg -> Result String { msg : msg, options : Html.Events.Options }
```

Or maybe by adding:
```elm
getOptions : Event msg -> Result String Html.Events.Options
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by examining the Event.toResult entry point and the proposed getOptions API in the issue. Determine how simulated event handlers currently expose their result, then verify that callers can inspect Html.Events.Options, including preventDefault, when testing a found node's onClick handler.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.