aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-02-11 01:42:51 -0500
committerJohn Resig <jeresig@gmail.com>2010-02-11 01:42:51 -0500
commit021b809acecc4e94613375b3182c86722470fe9b (patch)
tree77b70e014be92b036401945d08cf35aeec3eeee1 /test
parent639f4931b0409a8eb83aaf89a03b6b52f674663e (diff)
downloadjquery-021b809acecc4e94613375b3182c86722470fe9b.tar.gz
jquery-021b809acecc4e94613375b3182c86722470fe9b.zip
Make sure that the teardown is called after all the handlers of a type are removed. Fixes #6065.
Diffstat (limited to 'test')
-rw-r--r--test/unit/event.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index e85c4bd9d..33329c311 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -72,7 +72,7 @@ test("bind(), multiple events at once and namespaces", function() {
});
test("bind(), namespace with special add", function() {
- expect(18);
+ expect(19);
var div = jQuery("<div/>").bind("test", function(e) {
ok( true, "Test event fired." );
@@ -87,7 +87,9 @@ test("bind(), namespace with special add", function() {
equals( e.target, div[0], "And that the target is correct." );
},
setup: function(){},
- teardown: function(){},
+ teardown: function(){
+ ok(true, "Teardown called.");
+ },
add: function( handleObj ) {
var handler = handleObj.handler;
handleObj.handler = function(e) {
@@ -116,6 +118,8 @@ test("bind(), namespace with special add", function() {
// Should trigger 2
div.trigger("test.b");
+
+ div.unbind("test");
});
test("bind(), no data", function() {