Testing Submit Event

Testing Submit Event

Hi, I'm very new to jquery and have just started looking at qunit for testing and I have a bit of existing code that I would like to add a test to but I can't figure out how to write the test from the qunit examples. Can someone help, below is the code I would like to write a test for:

$(document).ready(function(){
   $("#ajax-contact-form").submit(function(){

      var str = $(this).serialize();

      $.ajax({
      type: "POST",
      url: "sendmail.php",
      data: str,
      success: function(msg){

         $("#note").ajaxComplete(function(event, request, settings){

            if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
            {
               result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
               $("#contactform").hide();
            }
            else
            {
            result = msg;
            }
            $(this).html(result);
         });
      }
      });
   return false;
   });
});

Many thanks
Martin