-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing components with {{each}} helper in layout fails #73
Comments
You need to tell the tests what other units it needs to register on the container with moduleForComponent('foo-component', 'FooComponent', {
needs: ['controller:item']
}); For example: https://github.com/instructure/ic-autocomplete/blob/master/test/main.spec.js#L2-L8 Unrelated ... using |
You're right, but it's not the only reason. The test fails on
Isolated container knows nothing about My component spec succeed after adding following setup callback moduleForComponent('dropdown-choice', 'DropdownChoice component', {
needs: [ 'controller:dropdown-choice-item'],
setup: function(container) {
container.register('controller:basic', Ember.Controller, { instantiate: false });
container.register('controller:object', Ember.ObjectController, { instantiate: false });
container.register('controller:array', Ember.ArrayController, { instantiate: false }); // needed by {{each}} helper with itemController set
}
}); The basic Ember controllers should be already available in the isolated container. |
yeah that sucks, care to make a PR adding everything under-the-sun that you know of inside of isolated container? |
* Ember.ObjectController * Ember.ArrayController * Ember.Controller [Fixes rwjblue/ember-qunit#73]
* Ember.ObjectController * Ember.ArrayController * Ember.Controller * Ember.Route * Ember.View * Ember.Select [Fixes rwjblue/ember-qunit#73]
Those classes are automatically registered by Ember: * Ember.ObjectController * Ember.ArrayController * Ember.Controller * Ember.Route * Ember.View * Ember.Select [Fixes rwjblue/ember-qunit#73]
Those classes are automatically registered by Ember: * Ember.ObjectController * Ember.ArrayController * Ember.Controller * Ember.Route * Ember.View * Ember.Select [Fixes rwjblue/ember-qunit#73]
Attempt to test components with
{{each item in items itemController='item'}}
in layout fails due to missingcontroller:array
registration on isolated container.Results
Foo component
and foo spec
The text was updated successfully, but these errors were encountered: