Ember.js tests fail when using select

I am using Ember 1.8.1 and I updated my code from

{{view Ember.Select content=items}} 

to

 {{view "select" content=items}} 

Now the problem is that my tests fail and I get this error:

 Error: Assertion Failed: select must be a subclass or an instance of Ember.View, not at new Error (native) at Error.EmberError (http://0.0.0.0:4201/assets/vendor.js:27425:23) at Object.Ember.assert (http://0.0.0.0:4201/assets/vendor.js:17039:15) at handlebarsGetView (http://0.0.0.0:4201/assets/vendor.js:20093:13) at EmberObject.create.helper (http://0.0.0.0:4201/assets/vendor.js:22801:19) at viewHelper (http://0.0.0.0:4201/assets/vendor.js:23051:25) at Object.anonymous (nea-client/templates/components/modal-workflow-create.js:18:54) at http://0.0.0.0:4201/assets/vendor.js:10863:33 at CoreView.extend.render (http://0.0.0.0:4201/assets/vendor.js:55473:20) at EmberRenderer_createElement [as createElement] (http://0.0.0.0:4201/assets/vendor.js:52700:16) 

Any ideas how to fix this? If I return the code to the old style, the tests pass, but I get a failure notice.

+5
source share
1 answer

In your test, do the following:

 import Ember from 'ember'; moduleForComponent('my-foobar', 'MyFoobarComponent', { setup: function() { this.container.register('view:select', Ember.Select); } } 

Doing this type of thing brings us a little closer to integration tests. It talks about how to improve the current state of things: https://github.com/rwjblue/ember-qunit/issues/74

+5
source

Source: https://habr.com/ru/post/1209222/


All Articles