emberjs / emberjs/ember-test-helpers

How to refresh current visiting page in Ember Test?

Open
#1,431 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
188
Forks
254
PR merge metrics
No merged PRs in 30d

Description

I changed untracked property and try to visit same page.
But the page didn't reload.

## Error case
```
test('visiting your route', async function (assert) {
await visit('your route');

// Change untracked property
// ...

await visit('your route');
})
```

So I changed as below code and it works well.
But it looks so strange...

## Solution

```
test('visiting your route', async function (assert) {
await visit('your route');

// Change untracked property
// ...

await visit('/')
await visit('your route');
})
```

Is there any better way to refresh current page?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two-visit example using the `visit` helper and compare it with the workaround that visits `/` first. Inspect the helper's existing behavior and tests around revisiting the current route; the issue is complete when the supported refresh approach, or the limitation, is clearly established.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.