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

This commit is contained in:
Brandon Aaron 2009-05-04 04:54:09 +00:00
parent 31b573185b
commit 4460d5ad59

View file

@ -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();