lundi 30 novembre 2015

Emberjs link-to href test in integration component

I'm trying to test a link-to href property in an ember component. with ember 2.0 but when I render the component with renter hbs it renders this:

<div id=\"23\" class=\"ember-view\">
<p><!----></p>
<div class=\"participantes\">
    <a id=\"ember282\" class=\"ember-view\">     
        <span>rnt-ayl-bld-js-jvr-frd-edw</span>
    </a>
</div>  

and the href property is not rendered, I read that is something related to router but I'm not sure how to include the router in the test I tried something like:

moduleForComponent('conversation-item', 'Integration | Component | conversation item', {
integration: true,
setup(){
    const router = this.lookup('router:main');
    router.startRouting(true);
}

});

but the lookup function is not present

TypeError: 'undefined' is not a function (evaluating 'container.lookup('router:main')')




Aucun commentaire:

Enregistrer un commentaire