title: Writing Unit Tests for Form Elements
body: <p>I'm writing jasmine test cases for my validation function. This is the code for my function.</p>
  
  <pre><code>function validateCardNum(){
      var cardEntered = $('#cardNum').val();
      var cTypeVal = $('#cType').val();
      if(cTypeVal === 'visa'){
           var reg = /^4\d{15}$/; 
           if (!reg.test(cardEntered)) {
                 showError('#cardNum',errorMsg);
                  return false;    
            };
       }
  }
  </code></pre>
  
  <p>And this is the code I'm writing to test it:</p>
  
  <pre><code> describe('VISA Card Validations', function() {
      $('#cType').val() = 'visa';
      it('should not validate empty CC number', function() {
          $('#cardNum').val() = '';    
          expect(validateCardNum().toBe(false));
      });
    });
  </code></pre>
  
  <p>When I write this, I get this error:</p>
  
  <pre><code> ReferenceError: Invalid left-hand side in assignment
  </code></pre>
  
  <p>My question is how can I assign testing values to my input fields to test different case scenarios.</p>