I'm trying to unit test a $scope.selectAnswers(response); function. I'm able to build a "response" mock and pass it in successfully. However, inside of this selectAnswers function there are some other functions called like: var selectFirstSet(); (non $scope functions).
It doesn't seem to test the functionality inside of these additional functions like selectFirstSet() called within $scope.selectAnswers(). Mostly what I'm doing inside of these additional functions is checking a conditional and if it's met setting $scope.answerSuccess = true; however when it gets back to my $scope.selectAnswers() it's still false? My $scope.selectAnswers() checks if( $scope.answerSuccess === true) and if it is it then just returns out of the function all together.
Aucun commentaire:
Enregistrer un commentaire