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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
describe( "language.paginate option", function() {
dt.libs( {
js: [ 'jquery', 'datatables' ],
css: [ 'datatables' ]
} );
describe("Check the defaults", function () {
dt.html( 'basic' );
it("language.paginate defaults", function () {
$('#example').dataTable({
"pagingType": "full_numbers"
});
table = $('#example').DataTable().settings()[0].oLanguage.oPaginate;
expect(
table.sFirst == "First" &&
table.sPrevious == "Previous" &&
table.sNext == "Next" &&
table.sLast == "Last").toBe(true);
});
it("Paginate defaults are in the DOM", function () {
expect(
$('#example_first').html() == "First" &&
$('#example_previous').html() == "Previous" &&
$('#example_next').html() == "Next" &&
$('#example_last').html() == "Last" ).toBe(true);
});
dt.html( 'basic' );
it("Paginate can be defined", function () {
$('#example').dataTable( {
"pagingType": "full_numbers",
"language": {
"paginate": {
"first": "unit1",
"previous": "unit2",
"next": "unit3",
"last": "unit4"
}
}
});
table = $('#example').DataTable().settings()[0].oLanguage.oPaginate;
expect(
table.sFirst == "unit1" &&
table.sPrevious == "unit2" &&
table.sNext == "unit3" &&
table.sLast == "unit4").toBe(true);
});
it("paginate definition are in the dom", function () {
expect(
$('#example_first').html() == "unit1" &&
$('#example_previous').html() == "unit2" &&
$('#example_next').html() == "unit3" &&
$('#example_last').html() == "unit4" ).toBe(true);
});
});
});
|