1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-18 16:54:14 +01:00

Fix - unit test: Async behaviour could cause test to fail since the init might not have been complete (amazing that it was passing all this time - faster computers and faster JS engines now causing it to fail!)

This commit is contained in:
Allan Jardine 2012-04-13 18:22:18 +01:00
parent 9ec52faec5
commit e290b2cd7a

View File

@ -4,25 +4,9 @@ oTest.fnStart( "fnInitComplete" );
/* Fairly boring function compared to the others! */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( {
"bServerSide": true,
"sAjaxSource": "../../../examples/server_side/scripts/server_processing.php"
} );
var oSettings = oTable.fnSettings();
var mPass;
oTest.fnWaitTest(
"Default should be null",
null,
function () { return oSettings.fnInitComplete == null; }
);
oTest.fnWaitTest(
"Two arguments passed",
function () {
oSession.fnRestore();
mPass = -1;
$('#example').dataTable( {
@ -50,7 +34,7 @@ $(document).ready( function () {
}
} );
},
function () { return oTable.fnSettings() == mPass; }
function () { console.log( oTable.fnSettings(), mPass );return oTable.fnSettings() === mPass; }
);