samedi 21 novembre 2015

Testing events and document content in karma-jasmine unit-testing

I want to test the following functions using jasmine-karma unit testing but I can't find a way to do so.

function One:

$scope.info = function(text){
  $(":root").find("#info").remove();
  var htmlObject = "<div id='info' info-alert text='"+$sanitize(text)+"'/>";
  var comments = $compile( htmlObject )( $scope );
  $(document.body).append( comments );
};

function 2:

 $scope.$on('settingsChanged',function(){
  $scope.getSettings();
});

Aucun commentaire:

Enregistrer un commentaire