How to write test when moving to other hosted page


#1

Hi, I stuck at writing Acceptance-test for this case: My Ember app has an /login route, which will redirect to a login page, this login page is not from Ember app, it is hosted by Auth0. Any suggestions for writing test for this case ? Thanks.


#2

If I understand correctly, you’d like to test if the page redirects correctly? I guess you could have a service for that, e.g. something like:

import Service from '@ember/service';
export default Service.extend({
  redirectToExternal(url) {
    window.location.replace(url);
  }
});

Then you could mock that method in your test.


#3

Will try, thanks @francesconovy