Skip to content
Permalink
Browse files

Fix bad calls to .undelegate().

Remove two tests that assume "live" data structure.
  • Loading branch information...
dmethvin authored and timmywil committed Jul 28, 2011
1 parent 28c2330 commit 8b4bd89addd2bab64656f699ee003aea03987c63
Showing with 4 additions and 11 deletions.
  1. +4 −11 test/unit/event.js
@@ -371,7 +371,7 @@ test("bind/delegate bubbling, isDefaultPrevented", function() {
});
fakeClick( $anchor2 );
$anchor2.unbind( "click" );
$main.undelegate( "click" );
$main.undelegate( "#foo", "click" );
$anchor2.click(function(e) {
// Let the default action occur
});
@@ -380,7 +380,7 @@ test("bind/delegate bubbling, isDefaultPrevented", function() {
});
fakeClick( $anchor2 );
$anchor2.unbind( "click" );
$main.undelegate( "click" );
$main.undelegate( "#foo", "click" );
});

test("bind(), iframes", function() {
@@ -1188,7 +1188,7 @@ test("toggle(Function, Function, ...)", function() {
});

test(".live()/.die()", function() {
expect(66);
expect(65);

var submit = 0, div = 0, livea = 0, liveb = 0;

@@ -1284,9 +1284,6 @@ test(".live()/.die()", function() {
jQuery("body").trigger("click");
equals( clicked, 2, "live with a context" );

// Make sure the event is actually stored on the context
ok( jQuery._data(container, "events").live, "live with a context" );

// Test unbinding with a different context
jQuery("#foo", container).die("click");
jQuery("#foo").trigger("click");
@@ -1703,7 +1700,6 @@ test("live with special events", function() {
jQuery("#liveSpan1").trigger("foo");

// Run: Handler 1, Default
// TODO: Namespace doesn't trigger default (?)
jQuery("#liveSpan1").trigger("foo.a");

// Run: remove
@@ -1719,7 +1715,7 @@ test("live with special events", function() {
});

test(".delegate()/.undelegate()", function() {
expect(65);
expect(64);

var submit = 0, div = 0, livea = 0, liveb = 0;

@@ -1815,9 +1811,6 @@ test(".delegate()/.undelegate()", function() {
jQuery("body").trigger("click");
equals( clicked, 2, "delegate with a context" );

// Make sure the event is actually stored on the context
ok( jQuery._data(container, "events").live, "delegate with a context" );

// Test unbinding with a different context
jQuery("#qunit-fixture").undelegate("#foo", "click");
jQuery("#foo").trigger("click");

0 comments on commit 8b4bd89

Please sign in to comment.
You can’t perform that action at this time.