title: Jasmine Karma Unit Testing on form fields
body: <p>I want to write unit test cases for username,email validation and submit button click without using protractor. Is it possible to do so?? If not then what is the other way by which I can write test cases on them.</p>
  
  <p>My Form for reference :</p>
  
  <pre><code>  &lt;form  class="elegant-aero" name="sampleForm" novalidate&gt;
    &lt;p&gt;
          &lt;label&gt;Username:&lt;/label&gt;
          &lt;input type="text" class="form-control" name="username" ng-model="username" required &gt;
          &lt;span ng-show="sampleForm.username.$error.required"&gt;Username is required.&lt;/span&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;label&gt;Email:&lt;/label&gt;
          &lt;input type="email" class="form-control" name="email" ng-model="email" required&gt;
          &lt;span ng-show="sampleForm.email.$error.required"&gt;Email is required.&lt;/span&gt;
          &lt;span ng-show="sampleForm.email.$error.email"&gt;Invalid email address.&lt;/span&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;button class="btn btn-link" ng-click="reset()"&gt;Reset&lt;/button&gt;
          &lt;input type="submit" class="btn btn-primary" ng-disabled="sampleForm.$invalid" ng-click="checkData()"&gt;
      &lt;/p&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>Controller js file for reference:</p>
  
  <p>var validUsername = "Thodoris Bais";
      var validEmail = "thodoris.bais@gmail.com";</p>
  
  <pre><code>   $scope.reset = function(){
  
          $scope.username = "";
          $scope.email = "";
     }   
  
  app.controller("myCtrl", function($scope, $http) {
     $scope.checkData = function() {
  
          if ($scope.username != validUsername || $scope.email != validEmail) {
              alert("The data provided do not match with the default owner");
          } else {
              alert("Seems to be ok!");
          }
      }
  
  });
  </code></pre>
  
  <p>Please help as I am new to jasmine karma and just started learning.</p>
  
  <p>Thanks in advance.</p>