mardi 22 mai 2018

How can I retrieve a route's model() when writing a test?

I have a route that has its own model, which does not come from the Ember store (let's say it can come from "anywhere" for the sake of this question).

  model() {
    return RSVP.hash({
      value: someCall()
    });
  }

this.owner.lookup('route:routeName').model() does not seem to work, neither does this.owner.lookup('controller:controllerName').get('model.X') or any of the other things I've tried.

Nor does it seem to be mentioned at https://guides.emberjs.com/v3.1.0/testing/testing-routes/

How would you retrieve a route's model in a test?




Aucun commentaire:

Enregistrer un commentaire