Cannot trigger action in a component when in test mode


#1

I am instantiating a component manually and appending it to DOM. For some reason I don’t seem to be able to trigger the action on that component using click action, but if I were to manually call ‘send’ on the action then it works. Here is a jsbin link to the test: http://jsbin.com/copum/1/

    //THIS DOESN'T WORK
    click('button.click-me');
    andThen(function(){
        expect(find('#click-status').length).to.be(1);              
    }); 

    /*
    //THIS WORKS THOUGH
    Ember.run(function(){
        documentCollection.send('clickMe');
    });
    andThen(function(){
        expect(find('#click-status').length).to.be(1);              
    });             
    */

Any way I can make things work with click event?? I also have a stackoverflow question, open here : http://stackoverflow.com/questions/25687938/cannot-trigger-action-in-a-component-when-testing Any help will be much appreciated. thanks


#2

This issue was resolved - Toran has posted a solution to my problem. I had to make a call to visit("/").