Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new helper ("getCurrentPathName" or similar) to better deal with "toc_routing-transition-methods" deprecation ? #948

Open
romgere opened this issue Nov 27, 2020 · 1 comment

Comments

@romgere
Copy link

romgere commented Nov 27, 2020

Hi !

According to this deprecation I started to replace some calls to replaceRoute & transitionToRoute by calls on router service on my ember App...

The result was a lot of failing test (mainly test using getCurrentURL helper) because of URL now includes Query Params :

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.
(see RouterService transitionTo documentation)

On some test, I replaced the getCurrentURL by getCurrentRouteName helper & it works great.

But for some tests, I can't because I need to test the route, but also the dynamic segment value like :

assert.equal(
  getCurrentURL(),
  `a/route/with/${model_id}/model`,
  "..."
)

What I've done to fix this, is create a new helper returning only the pathName of the current URL.

So I'm wonder if a such helper could be implemented here as a part of ember-test-helpers ?

I can create a PR for this, but just want to be sure it's a good idea before working on it 🤔

@rwjblue
Copy link
Member

rwjblue commented Mar 19, 2021

Sorry for the delayed response here, I'm not 100% sure what the goal of the new helper would actually be. Can you give me a couple of example inputs/outputs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants