lundi 13 juillet 2020

EmberJS testing: Testing a component inside a component

I'm new to Ember, and I'm trying to learn how to write tests.

At the moment I have a component, lets call it "ParentComponent" and to simplify, it looks like this.

<div>
    <div class="childDiv">
        
    </div>
    <div>
        other stuff
    </div>
</div>

I am writing an integration component test on ParentComponent and I would like to test to make sure "trait" is true. someBoolean is determined inside the ParentComponent, and can be true or false. At the moment my test looks something like this:

test('my test', async function(assert){
    this.set('someBoolean', true)
    await render(hbs`
    
    `)
    
    // insert code here
});

At the "insert code here", I'd like to be able to check that childComponent's "trait" is indeed equal to true.




Aucun commentaire:

Enregistrer un commentaire