You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR: calling currentURL() in acceptance tests before any calls to visit() worked in Ember 1.11 but throws an error in Ember 1.12.0-beta.1.
I have an acceptance test that interacts with a modal-like search interface that is accessible from some routes in the application. I wrote some helper methods to reduce repetition in the tests, they look something like this:
var searchFor = function(query) {
showSearch();
fillIn('.search-pane input', query);
};
var showSearch = function() {
andThen(function() {
if (currentURL().indexOf('path with access to the search') === -1) {
visit('path with access to the search')
}
});
// Show the search if not already showing
andThen(function() {
if (find('.search-pane input').length === 0) {
click('.search div');
}
});
};
This way I can searchFor('something') and not have to care whether I’m at the right path or whether the search interface is currently showing.
In Ember 1.12.0-beta.1, I can no longer check currentURL() to see whether I need to navigate somewhere before searching because it throws undefined is not a function at this line, specifically from the call to property_get(router, 'location').
Is this a desired change? Maybe it makes sense to require a call to visit() before checking the URL, but it was an unexpected change to work around. If a call to visit() is to be required, maybe there could be an error message to that effect?
TLDR: calling
currentURL()
in acceptance tests before any calls tovisit()
worked in Ember 1.11 but throws an error in Ember 1.12.0-beta.1.I have an acceptance test that interacts with a modal-like search interface that is accessible from some routes in the application. I wrote some helper methods to reduce repetition in the tests, they look something like this:
This way I can
searchFor('something')
and not have to care whether I’m at the right path or whether the search interface is currently showing.In Ember 1.12.0-beta.1, I can no longer check
currentURL()
to see whether I need to navigate somewhere before searching because it throwsundefined is not a function
at this line, specifically from the call toproperty_get(router, 'location')
.Is this a desired change? Maybe it makes sense to require a call to
visit()
before checking the URL, but it was an unexpected change to work around. If a call tovisit()
is to be required, maybe there could be an error message to that effect?Some demonstrative JS Bins, adapted from the other current
currentURL
issue:Working in Ember 1.11.0
Broken in Ember 1.12.0-beta.1
Still broken after #10805 (hopefully I have the right script tags there, it’s also copied from the other issue)
The text was updated successfully, but these errors were encountered: