emberjs / emberjs/ember.js

Introducing a loading route prevents query params from being resolved in an acceptance test

Open
#15,800 0 comments 2 reactions 0 assignees View on GitHub
Has Reproduction Query Params Routing
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

@lifeart has found this bug.

## Steps to reproduce

```
git clone git@github.com:ember-learn/ember-api-docs.git
cd ember-api-docs/
git co 542b6065553ac6849635865e84c7b96f77c72261
bower i
yarn
ember t -s --no-launch -f 'has query params for access visibilities'
```

Open http://http://localhost:7357 and you can see tests pass.

Now create a loading route:

ember g template project-version/classes/class-loading

And the test will fail. The app for a normal user behaves correctly.

## Debugging

1. Drop `debugger`s [here](https://github.com/ember-learn/ember-api-docs/blob/542b6065553ac6849635865e84c7b96f77c72261/tests/acceptance/class-test.js#L41) and [here](https://github.com/ember-learn/ember-api-docs/blob/542b6065553ac6849635865e84c7b96f77c72261/app/mixins/filter-params.js#L34).
2. Comment out all content of the `has query params for access visibilities` test and comment out all clicks from the `beforeEach` hook.

When you don't have the loading route, the `visibilityFilter` setter fires before the acceptance test.

When you introduced the loading route, the `visibilityFilter` setter is never fired.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.