[6286] | 1 | // DATA_TEMPLATE: dom_data |
---|
| 2 | oTest.fnStart( "oLanguage.sInfoPostFix" ); |
---|
| 3 | |
---|
| 4 | $(document).ready( function () { |
---|
| 5 | /* Check the default */ |
---|
| 6 | var oTable = $('#example').dataTable(); |
---|
| 7 | var oSettings = oTable.fnSettings(); |
---|
| 8 | |
---|
| 9 | oTest.fnTest( |
---|
| 10 | "Info post fix language is '' (blank) by default", |
---|
| 11 | null, |
---|
| 12 | function () { return oSettings.oLanguage.sInfoPostFix == ""; } |
---|
| 13 | ); |
---|
| 14 | |
---|
| 15 | oTest.fnTest( |
---|
| 16 | "Width no post fix, the basic info shows", |
---|
| 17 | null, |
---|
| 18 | function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries"; } |
---|
| 19 | ); |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | oTest.fnTest( |
---|
| 23 | "Info post fix language can be defined", |
---|
| 24 | function () { |
---|
| 25 | oSession.fnRestore(); |
---|
| 26 | oTable = $('#example').dataTable( { |
---|
| 27 | "oLanguage": { |
---|
| 28 | "sInfoPostFix": "unit test" |
---|
| 29 | } |
---|
| 30 | } ); |
---|
| 31 | oSettings = oTable.fnSettings(); |
---|
| 32 | }, |
---|
| 33 | function () { return oSettings.oLanguage.sInfoPostFix == "unit test"; } |
---|
| 34 | ); |
---|
| 35 | |
---|
| 36 | oTest.fnTest( |
---|
| 37 | "Info empty language default is in the DOM", |
---|
| 38 | null, |
---|
| 39 | function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries unit test"; } |
---|
| 40 | ); |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | oTest.fnTest( |
---|
| 44 | "Macros have no effect in the post fix", |
---|
| 45 | function () { |
---|
| 46 | oSession.fnRestore(); |
---|
| 47 | oTable = $('#example').dataTable( { |
---|
| 48 | "oLanguage": { |
---|
| 49 | "sInfoPostFix": "unit _START_ _END_ _TOTAL_ test" |
---|
| 50 | } |
---|
| 51 | } ); |
---|
| 52 | }, |
---|
| 53 | function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries unit _START_ _END_ _TOTAL_ test"; } |
---|
| 54 | ); |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | oTest.fnTest( |
---|
| 58 | "Post fix is applied after fintering info", |
---|
| 59 | function () { |
---|
| 60 | oSession.fnRestore(); |
---|
| 61 | oTable = $('#example').dataTable( { |
---|
| 62 | "oLanguage": { |
---|
| 63 | "sInfoPostFix": "unit test" |
---|
| 64 | } |
---|
| 65 | } ); |
---|
| 66 | oTable.fnFilter("nothinghere"); |
---|
| 67 | }, |
---|
| 68 | function () { return document.getElementById('example_info').innerHTML = "Showing 0 to 0 of 0 entries unit (filtered from 57 total entries) test"; } |
---|
| 69 | ); |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | oTest.fnComplete(); |
---|
| 73 | } ); |
---|