title: Right way to unit test a component in EmberJS
body: <p>I am trying to test a component in my Ember application unit tests, and until now all is good except that I am at a point where the assertions need its template to be rendered.</p>
  
  <p>To do so normally one would call</p>
  
  <pre><code>var comp = App.SomeNamedComponent.create();
  var comp.appendTo(App.rootElement);
  </code></pre>
  
  <p>But while this does create the base element of the component, it does not render its template. After a few research, I ended-up finding out that neither <code>templateName</code> nor <code>template</code> properties are set on the component. So I decided to set the <code>templateName</code> myself, but then it complains that <code>A Component must have a parent view in order to yield.</code>.</p>
  
  <p>I then decided to create another custom view in the test with a template using that component, but then I can't access the instance of the component...</p>
  
  <p>I need to access the instance to make the assertions, and I need to have it's template rendered as some properties are calculated depending on the css of some elements in the template.</p>