avh4/elm-program-test

Add support for navigation (back, forward)

Open

#40 建立於 2019年6月27日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)Elm (28 fork)github user discovery
enhancementgood first issuehelp wantedsemver: minor

倉庫指標

Star
 (95 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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.

貢獻者指南