Feature request: Add ProgramTest.ensurePageChange
- Dominant language
- Elm
- Stars
- 95
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
There is a [`expectPageChange` function](https://package.elm-lang.org/packages/avh4/elm-program-test/3.6.3/ProgramTest#expectPageChange) in the API, but there is no `ensurePageChange`.
# Context
We would like to have a test that asserts the flow of multiple pages, and the flow includes a click on a link.
```elm
-- ...
|> ProgramTest.clickLink "Text" "href"
|> ProgramTest.ensurePageChange "/href"
-- do more assertions once the page has changed
```
Is there a limitation in the framework to do this, or is it counter to the philosophy of the tool?
Contributor guide
Research direction
Start by reading the existing expectPageChange API and the clickLink flow in the ProgramTest documentation or source. Determine how a chained ensurePageChange should assert navigation to the requested path, then add coverage showing that later assertions run after the page change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elm
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100