Skip to content
Permalink
Browse files

unit tests for using jQuery events on non-dom elements. fixes #3439. …

…thanks morgan
  • Loading branch information
brandonaaron committed May 4, 2009
1 parent 31b5731 commit 4460d5ad5949e5c9bf58d5de72b1d8b308181bf7
Showing with 21 additions and 0 deletions.
  1. +21 −0 test/unit/event.js
@@ -688,6 +688,27 @@ test(".live()/.die()", function() {
jQuery('span#liveSpan1').die('click');
});

test("Non DOM element events", function() {
expect(3);

jQuery({})
.bind('nonelementglobal', function(e) {
ok( true, "Global event on non-DOM annonymos object triggered" );
});

var o = {};

jQuery(o)
.bind('nonelementobj', function(e) {
ok( true, "Event on non-DOM object triggered" );
}).bind('nonelementglobal', function() {
ok( true, "Global event on non-DOM object triggered" );
});

jQuery(o).trigger('nonelementobj');
jQuery.event.trigger('nonelementglobal');
});

/*
test("jQuery(function($) {})", function() {
stop();

0 comments on commit 4460d5a

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