Usually a lookup
requires a container, so a hint of what I think is causing the problem. This makes sense because DS
relies on the container to be able to view registered models in model:model-name
;
So your test dependency for this mixin is really on the correct setting for Ember Data. Therefore, if you conduct a test to make it work for the Ember Data model, mixin more or less just snaps into place with the object set up as it expects.
I would try using moduleForModel
from the useful Ember doc :
moduleForModel('dictionary-manager-model'); test('your test here', function(assert) {
Do you need to conditionally translate to mixin with a model? If your model always uses mixin, you can do this in the model definition file and simply test it as shown above. In your example, mixin is added to the model and the model is passed to createRecord`, but this is not recommended:
https://github.com/emberjs/data/blob/v2.14.10/addon/-private/system/store.js#L351 assert(
Removing classes for storing methods has been deleted. Please pass dasherized string instead of $ {modelName} , typeof modelName === 'string');
Therefore, we rely on container searches.
Essentially, I think you passed the model test, not the mixin test. If the mixture cannot be flipped into something that is not a model and still works.
ember generate model-test dictionary-manager-model
if it does not already exist and then your model file mixes the mixture. Besides, maybe this should not be a separate mixin?
Hope this helps you get started in the right direction, cheers! ✌🏽
source share