elm-program-test
elm-program-test copied to clipboard
Add support for navigation (back, forward)
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.
Back is done in #94