1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
describe( "stateDuration Option", function() {
dt.libs( {
js: [ 'jquery', 'datatables' ],
css: [ 'datatables' ]
} );
describe("Default tests", function () {
dt.html( 'basic' );
it("Test using session storage", function () {
$('#example').dataTable( {
"stateSave": true,
"stateDuration": -1
} );
$('#example_filter input').val('London').keyup();//remove once stateSave is saving on first draw
expect(sessionStorage["DataTables_example_/debug.html"]).toBeDefined();
});
dt.html( 'basic' );
it("Test using localStorage", function () {
$('#example').dataTable( {
"stateSave": true,
"stateDuration": 1
} );
expect(localStorage['DataTables_example_/debug.html']).toBeDefined();
});
});
});
|