]> source.dussan.org Git - jquery.git/commitdiff
Tests: Test AJAX deprecated event aliases properly
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Wed, 15 Mar 2023 10:44:08 +0000 (11:44 +0100)
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Wed, 15 Mar 2023 10:45:26 +0000 (11:45 +0100)
PR gh-5046 erroneously changed AJAX deprecated event alias
usage in deprecated tests to `.on()` calls. This change
reverses this mistake.

Closes gh-5195
Ref gh-5046

(cherry picked from commit cff2899885c314d32eea42e9eef6ead6e5da5c2f)

test/unit/deprecated.js

index ce03f25d8ae45d527f04db6de9b72ad8f064dbb1..4d8d00f009852ca8bfc53a946b702dafe223b72a 100644 (file)
@@ -97,7 +97,7 @@ QUnit.test( "trigger() shortcuts", function( assert ) {
 } );
 
 if ( includesModule( "ajax" ) ) {
-       ajaxTest( "jQuery.ajax() - events with context", 12, function( assert ) {
+       ajaxTest( "Ajax events aliases (with context)", 12, function( assert ) {
                var context = document.createElement( "div" );
 
                function event( e ) {
@@ -113,10 +113,10 @@ if ( includesModule( "ajax" ) ) {
                return {
                        setup: function() {
                                jQuery( context ).appendTo( "#foo" )
-                                       .on( "ajaxSend", event )
-                                       .on( "ajaxComplete", event )
-                                       .on( "ajaxError", event )
-                                       .on( "ajaxSuccess", event );
+                                       .ajaxSend( event )
+                                       .ajaxComplete( event )
+                                       .ajaxError( event )
+                                       .ajaxSuccess( event );
                        },
                        requests: [ {
                                url: url( "name.html" ),