title: Unable to complete the code coverage if the conditional statement is in Jquery - Jasmine - AngularJs
body: <p>My project is written in angular and test cases in Jasmine. These test cases are run with Karma.</p>
  
  <p>I have a scope function in the controller that has a if condition in it. This if condition statement is in Jquery. I am not sure how to test the if and else part of this code. </p>
  
  <pre><code>$scope.getHelperMessage = function(type, target) {  
          $scope.helperMessageHidden = false;     
          $(target).addClass("icon-selected");
  
          if (type === "password") { // this if condition is covered when I pass type as "password" in the fn args
              $scope.helperMessage = passwordInfoMsg;
          } else if (type === "personal") {
              $scope.helperMessage = personalNumberInfoMsg;
          } else if (type === "email") {
              if ($(".email-wrapper .error-icon").css('display') === 'none') { // this if condition is not covered as i dont know how to set this statement in my test case
                  $scope.helperMessageHidden = true;
              } else {
                  $(".form-message-container p").html(alreadyRegisteredInfoMsg);
              }               
          }
      }
  </code></pre>
  
  <p>Here is my test case for the above scope function</p>
  
  <pre><code>describe('on focus of any input field', function() {    
  
          it('should show the password helper message', inject( function(passwordInfoMsg){ 
              var type = "password";
              var target = ".password-wrapper .info-icon";            
              scope.getHelperMessage(type, target);
              expect(scope.helperMessageHidden).toBe(false);
              expect(scope.helperMessage).toBe(passwordInfoMsg);
          }));    
  
          it('should show the personal number helper message', inject( function(personalNumberInfoMsg){ 
              var type = "personal";
              var target = ".personal-wrapper .info-icon";
              scope.getHelperMessage(type, target);
              expect(scope.helperMessageHidden).toBe(false);
              expect(scope.helperMessage).toBe(personalNumberInfoMsg);    
          }));    
  
          it('should show the already exists email helper message', inject( function(alreadyRegisteredInfoMsg){ 
              var type = "email";
              var target = ".email-wrapper .error-icon"; // here I dont know how to set the value for if condition            
              scope.getHelperMessage(type, target);
              expect(scope.helperMessageHidden).toBe(false);
          }));
  });
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/CIqPr.png" alt="Screenshot of the code coverage for this scope function"></p>