1

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);                  
    });                
  }              
}
0

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

5 Comments

how can i get promise from action?
i want to test action which return promise.
You can't. The action doesn't return a promise or anything else.
are you sure? This is main part of my application. also routing and just for it need test :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.