Skip to content

Commit 0564553

Browse files
committed
Fix the number of change tests and remove textarea tests.
1 parent 21d389c commit 0564553

File tree

1 file changed

+6
-32
lines changed

1 file changed

+6
-32
lines changed

test/unit/event.js

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,8 @@ test("live with namespaces", function(){
12381238
});
12391239

12401240
test("live with change", function(){
1241+
expect(8);
1242+
12411243
var selectChange = 0, checkboxChange = 0;
12421244

12431245
var select = jQuery("select[name='S1']")
@@ -1269,28 +1271,13 @@ test("live with change", function(){
12691271
checkbox.trigger("change");
12701272
equals( checkboxChange, 1, "Change on checkbox." );
12711273

1272-
// test before activate on radio
1273-
1274-
// test blur/focus on textarea
1275-
var textarea = jQuery("#area1"), textareaChange = 0, oldVal = textarea.val();
1276-
textarea.live("change", function() {
1277-
textareaChange++;
1278-
});
1279-
1280-
textarea.val(oldVal + "foo");
1281-
textarea.trigger("change");
1282-
equals( textareaChange, 1, "Change on textarea." );
1283-
1284-
textarea.val(oldVal);
1285-
textarea.die("change");
1286-
12871274
// test blur/focus on text
12881275
var text = jQuery("#name"), textChange = 0, oldTextVal = text.val();
12891276
text.live("change", function() {
12901277
textChange++;
12911278
});
12921279

1293-
text.val(oldVal+"foo");
1280+
text.val(oldTextVal+"foo");
12941281
text.trigger("change");
12951282
equals( textChange, 1, "Change on text input." );
12961283

@@ -1707,6 +1694,8 @@ test("delegate with multiple events", function(){
17071694
});
17081695

17091696
test("delegate with change", function(){
1697+
expect(8);
1698+
17101699
var selectChange = 0, checkboxChange = 0;
17111700

17121701
var select = jQuery("select[name='S1']");
@@ -1738,28 +1727,13 @@ test("delegate with change", function(){
17381727
checkbox.trigger("change");
17391728
equals( checkboxChange, 1, "Change on checkbox." );
17401729

1741-
// test before activate on radio
1742-
1743-
// test blur/focus on textarea
1744-
var textarea = jQuery("#area1"), textareaChange = 0, oldVal = textarea.val();
1745-
jQuery("#body").delegate("#area1", "change", function() {
1746-
textareaChange++;
1747-
});
1748-
1749-
textarea.val(oldVal + "foo");
1750-
textarea.trigger("change");
1751-
equals( textareaChange, 1, "Change on textarea." );
1752-
1753-
textarea.val(oldVal);
1754-
jQuery("#body").undelegate("#area1", "change");
1755-
17561730
// test blur/focus on text
17571731
var text = jQuery("#name"), textChange = 0, oldTextVal = text.val();
17581732
jQuery("#body").delegate("#name", "change", function() {
17591733
textChange++;
17601734
});
17611735

1762-
text.val(oldVal+"foo");
1736+
text.val(oldTextVal+"foo");
17631737
text.trigger("change");
17641738
equals( textChange, 1, "Change on text input." );
17651739

0 commit comments

Comments
 (0)