mardi 7 avril 2020

Ember Associations Are Not Respecting Model Custom Adapter in Test Environment

In my Ember.js app I have a model Company with a custom adapter that points to an API. I also have a User model with a custom adapter that points to a different API and a belongsTo association with Company (via a user#companyId attribute).

When manually exercising the app, all references to a Company in the code seem to send requests to the correct endpoint defined in the Company's custom adapter. However when running tests (both unit and acceptance tests), direct queries for a company this.store.find... hit the correct endpoint (company-host.com/api/companies/1), but references to a Company through its association with a User user.company are pointing to the User adapter's host and namespace (user-host.com/api/companies/1).

I'm new to Ember and any help or insight would be appreciated.




Aucun commentaire:

Enregistrer un commentaire