-
Notifications
You must be signed in to change notification settings - Fork 18
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
Visit helper not returning correct content upon using this.replaceWith
for redirection
#204
Comments
Hey @dnalagatla! Thanks for reporting this. So I pulled up an old issue from the FastBoot repo about I think maybe fastboot testing should support having Also, are you able to work around this issue today or is it blocking you? |
Hi @ryanto, thank you for looking into this issue. I wasn't aware of that issue in Fastboot. That was useful to get some context. The idea of passing We are not blocked on this issue, will be useful. I can work on a PR |
@ryanto I'm hitting this in a production fastboot app... still searching for how to handle it properly |
@erichonkanen it's actually valid scenario that you do not get the DOM of the route to which the initial route redirects using Each url in the web represents unique content hence when you do When app redirects browser to another url, it does so by sending 301/307/308/etc. status code and browsers respect that and navigate to the url retuned in I guess, in your case you either need to stick to the redirect (and let browser navigate to the new url and get content from it) or you need to switch from using Said above, this does not sound like an issue with this package. |
Currently, the Visit helper returns
<body><h1>Redirecting to ...
as DOM content instead of the DOM of the route to which the initial route redirects usingthis.replaceWith
.The issue is happening at this returned value - https://github.com/embermap/ember-cli-fastboot-testing/blob/master/index.js#L86
As fastboot provides the html content based on the statusCode and if it is a redirection getting redirection text - https://github.com/embermap/ember-cli-fastboot-testing/blob/master/addon-test-support/index.js#L46
I think for testing the finalized body should be provided by using
page.domContents().body
as HTML content.The text was updated successfully, but these errors were encountered: