Nininea
Nininea

Reputation: 2729

Cannot read property 'then' of undefined

inside test file I want to check results after action

ctrl.send('createLoanApplication').then(function(){
  console.log('test');       
});

this is action

createLoanApplication: function () {
  var value = this.get('selectedCompany');
  if (value) {
    var controller = this;
    return  $.post('/api/loanapplication/create/' + value).done(function (data) {
      controller.transitionToRoute('loan-details', data.id);                  
    });                
  }              
}

Upvotes: 1

Views: 847

Answers (1)

user663031
user663031

Reputation:

send does not return a value. Therefore you cannot take a then of its result.

Upvotes: 2

Related Questions