mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-27 14:14:11 +01:00
25 lines
600 B
JavaScript
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);
|
|
} );
|
|
} );
|
|
|
|
} );
|