Fix some whitespace issues.
[jquery.git] / test / unit / event.js
index 8d69807..b7b2604 100644 (file)
@@ -615,18 +615,18 @@ test("unbind(type)", function() {
 
        message = "unbind many with function";
        $elem.bind('error1 error2',error)
-                .unbind('error1 error2', error )
-                .trigger('error1').triggerHandler('error2');
+               .unbind('error1 error2', error )
+               .trigger('error1').triggerHandler('error2');
 
        message = "unbind many"; // #3538
        $elem.bind('error1 error2',error)
-                .unbind('error1 error2')
-                .trigger('error1').triggerHandler('error2');
+               .unbind('error1 error2')
+               .trigger('error1').triggerHandler('error2');
 
        message = "unbind without a type or handler";
        $elem.bind("error1 error2.test",error)
-                .unbind()
-                .trigger("error1").triggerHandler("error2");
+               .unbind()
+               .trigger("error1").triggerHandler("error2");
 });
 
 test("unbind(eventObject)", function() {
@@ -1455,6 +1455,8 @@ test("live with change", function(){
 });
 
 test("live with submit", function() {
+       expect(5);
+
        var count1 = 0, count2 = 0;
 
        jQuery("#testForm").live("submit", function(ev) {
@@ -1471,7 +1473,16 @@ test("live with submit", function() {
        equals( count1, 1, "Verify form submit." );
        equals( count2, 1, "Verify body submit." );
 
+       jQuery("#testForm input[name=sub1]").live("click", function(ev) {
+               ok( true, "cancelling submit still calls click handler" );
+       });
+
+       jQuery("#testForm input[name=sub1]")[0].click();
+       equals( count1, 2, "Verify form submit." );
+       equals( count2, 2, "Verify body submit." );
+
        jQuery("#testForm").die("submit");
+       jQuery("#testForm input[name=sub1]").die("click");
        jQuery("body").die("submit");
 });