Skip to content

Add regression tests for RouterService transitionTo#21409

Open
olenderhub wants to merge 2 commits into
emberjs:mainfrom
olenderhub:tests/router-service-transitionto-unchanged-qps
Open

Add regression tests for RouterService transitionTo#21409
olenderhub wants to merge 2 commits into
emberjs:mainfrom
olenderhub:tests/router-service-transitionto-unchanged-qps

Conversation

@olenderhub
Copy link
Copy Markdown
Contributor

This adds regression coverage for the behavior described in #19497.

The tests cover both route-name transitions and URL-string transitions with RouterService#transitionTo, and verify that the parent route's model hook is not re-run when transitioning to a child route with unchanged query params.

This contributes to the routing test coverage work tracked in #19609.

Refs #19497
Refs #19609

this.add(
'controller:parent.child',
Controller.extend({
queryParams: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this config go on the route?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NullVoxPopuli Thank you for this comment. I am sorry, I didn't reproduce this properly, so these tests passed. I pushed code with I believe proper reproduction of your twiddle code #19497 (comment), then I noticed this issue still exit, so I also pushed proposition of fix to this problem. After this pnpm run test:wip passing. Please check it again

…params

Add two tests verifying that RouterService#transitionTo does not re-run
the application model hook when transitioning with unchanged query params
- one using route name, the other using URL string.
- Skip model refresh when query param serialized value matches the
  last finalized value, preventing spurious refreshes during sticky
  QP hydration or URL transitions with unchanged default values
- Fixes regression where transitionTo with same-valued application
  query params and refreshModel: true would abort the transition
@olenderhub olenderhub force-pushed the tests/router-service-transitionto-unchanged-qps branch from 5855634 to a065381 Compare May 30, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants