avh4/elm-program-test

Add support for navigation (back, forward)

Open

#40 geöffnet am 27. Juni 2019

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Elm (28 Forks)github user discovery
enhancementgood first issuehelp wantedsemver: minor

Repository-Metriken

Stars
 (95 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

The browser history is already maintained in the ProgramTest model (inspectable with expectBrowserUrl and expectBrowserHistory). This issue would add back and forward to SimulatedEffect.Navigation to parallel the functions in https://package.elm-lang.org/packages/elm/browser/latest/Browser-Navigation . Simulating those events should have the effect of calling routeChangeHelper with the new URL if the action can be performed, or failing the test if not.

Implementing forward will require adding the forward "history" to the ProgramTest model.

If you are looking to contribute, feel free to make a PR that only implements one of these functions. This is marked "good first issue", but you'd need to have a good understanding of using elm-program-test and of https://elm-program-test.netlify.com/cmds.html or else this probably won't be easy.

Contributor Guide