@@ -1238,6 +1238,8 @@ test("live with namespaces", function(){
1238
1238
} ) ;
1239
1239
1240
1240
test ( "live with change" , function ( ) {
1241
+ expect ( 8 ) ;
1242
+
1241
1243
var selectChange = 0 , checkboxChange = 0 ;
1242
1244
1243
1245
var select = jQuery ( "select[name='S1']" )
@@ -1269,28 +1271,13 @@ test("live with change", function(){
1269
1271
checkbox . trigger ( "change" ) ;
1270
1272
equals ( checkboxChange , 1 , "Change on checkbox." ) ;
1271
1273
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
-
1287
1274
// test blur/focus on text
1288
1275
var text = jQuery ( "#name" ) , textChange = 0 , oldTextVal = text . val ( ) ;
1289
1276
text . live ( "change" , function ( ) {
1290
1277
textChange ++ ;
1291
1278
} ) ;
1292
1279
1293
- text . val ( oldVal + "foo" ) ;
1280
+ text . val ( oldTextVal + "foo" ) ;
1294
1281
text . trigger ( "change" ) ;
1295
1282
equals ( textChange , 1 , "Change on text input." ) ;
1296
1283
@@ -1707,6 +1694,8 @@ test("delegate with multiple events", function(){
1707
1694
} ) ;
1708
1695
1709
1696
test ( "delegate with change" , function ( ) {
1697
+ expect ( 8 ) ;
1698
+
1710
1699
var selectChange = 0 , checkboxChange = 0 ;
1711
1700
1712
1701
var select = jQuery ( "select[name='S1']" ) ;
@@ -1738,28 +1727,13 @@ test("delegate with change", function(){
1738
1727
checkbox . trigger ( "change" ) ;
1739
1728
equals ( checkboxChange , 1 , "Change on checkbox." ) ;
1740
1729
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
-
1756
1730
// test blur/focus on text
1757
1731
var text = jQuery ( "#name" ) , textChange = 0 , oldTextVal = text . val ( ) ;
1758
1732
jQuery ( "#body" ) . delegate ( "#name" , "change" , function ( ) {
1759
1733
textChange ++ ;
1760
1734
} ) ;
1761
1735
1762
- text . val ( oldVal + "foo" ) ;
1736
+ text . val ( oldTextVal + "foo" ) ;
1763
1737
text . trigger ( "change" ) ;
1764
1738
equals ( textChange , 1 , "Change on text input." ) ;
1765
1739
0 commit comments