mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-30 23:52:11 +01:00
Fixed: Unit tests could fail due to interaction between state saving cookies. Now when tests which state save end, they must call fnCookieDestroy.
This commit is contained in:
parent
6adec72aae
commit
4e11bf9e9c
@ -49,5 +49,6 @@ $(document).ready( function () {
|
|||||||
function () { return $('#example_filter input').val() == ''; }
|
function () { return $('#example_filter input').val() == ''; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
oTest.fnCookieDestroy( $('#example').dataTable() );
|
||||||
oTest.fnComplete();
|
oTest.fnComplete();
|
||||||
} );
|
} );
|
@ -35,5 +35,6 @@ $(document).ready( function () {
|
|||||||
function () { return $('#example thead th').length == 5; }
|
function () { return $('#example thead th').length == 5; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
oTest.fnCookieDestroy( $('#example').dataTable() );
|
||||||
oTest.fnComplete();
|
oTest.fnComplete();
|
||||||
} );
|
} );
|
@ -34,5 +34,6 @@ $(document).ready( function () {
|
|||||||
function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
|
function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
oTest.fnCookieDestroy( $('#example').dataTable() );
|
||||||
oTest.fnComplete();
|
oTest.fnComplete();
|
||||||
} );
|
} );
|
@ -92,5 +92,6 @@ $(document).ready( function () {
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
oTest.fnCookieDestroy( $('#example').dataTable() );
|
||||||
oTest.fnComplete();
|
oTest.fnComplete();
|
||||||
} );
|
} );
|
@ -103,6 +103,21 @@ var oTest = {
|
|||||||
this._fnNext();
|
this._fnNext();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: fnCookieDestroy
|
||||||
|
* Purpose: Destroy a cookie of a given name
|
||||||
|
* Returns: -
|
||||||
|
* Inputs: -
|
||||||
|
*/
|
||||||
|
"fnCookieDestroy": function ( oTable )
|
||||||
|
{
|
||||||
|
var sName = oTable.fnSettings().sCookiePrefix+oTable.fnSettings().sInstance;
|
||||||
|
var aParts = window.location.pathname.split('/');
|
||||||
|
var sNameFile = sName + '_' + aParts.pop().replace(/[\/:]/g,"").toLowerCase();
|
||||||
|
document.cookie = sNameFile+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+
|
||||||
|
aParts.join('/') + "/";
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user