git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e177465
)
Added some more tests for checking the execution order of events (from last night...
author
jeresig
<jeresig@gmail.com>
Thu, 4 Feb 2010 14:23:50 +0000
(09:23 -0500)
committer
jeresig
<jeresig@gmail.com>
Thu, 4 Feb 2010 14:23:50 +0000
(09:23 -0500)
test/unit/event.js
patch
|
blob
|
history
diff --git
a/test/unit/event.js
b/test/unit/event.js
index
9ce6e2f
..
2937b1c
100644
(file)
--- a/
test/unit/event.js
+++ b/
test/unit/event.js
@@
-317,6
+317,26
@@
test("bind(), with same function", function() {
equals(count, 1, "Verify that removing events still work." );
});
equals(count, 1, "Verify that removing events still work." );
});
+
+test("bind(), make sure order is maintained", function() {
+ expect(1);
+
+ var elem = jQuery("#firstp"), log = [], check = [];
+
+ for ( var i = 0; i < 100; i++ ) (function(i){
+ elem.bind( "click", function(){
+ log.push( i );
+ });
+
+ check.push( i );
+ })(i);
+
+ elem.trigger("click");
+
+ equals( log.join(","), check.join(","), "Make sure order was maintained." );
+
+ elem.unbind("click");
+});
test("bind(), with different this object", function() {
expect(4);
test("bind(), with different this object", function() {
expect(4);