Files
iTop/node_modules/jquery-migrate/test/ajax.js
2024-03-07 15:27:38 +01:00

25 lines
600 B
JavaScript

QUnit.module( "ajax" );
QUnit.test( "jQuery.ajax() deprecations on jqXHR", function( assert ) {
assert.expect( 3 );
var done = assert.async();
expectWarning( assert, ".success(), .error(), .compete() calls", 3, function() {
jQuery.ajax( "/not-found.404" )
.success( jQuery.noop )
.error( function( jQXHR ) {
// Local file errors returns 0, pretend it's a 404
assert.equal( jQXHR.status || 404, 404, "ajax error" );
} )
.complete( function() {
assert.ok( true, "ajax complete" );
// Wait for expectWarning to complete
setTimeout(done, 1);
} );
} );
} );