/[projects]/misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/2_js/oLanguage.sZeroRecords.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/2_js/oLanguage.sZeroRecords.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2125 - (show annotations) (download) (as text)
Wed Mar 12 19:30:05 2014 UTC (10 years, 3 months ago) by torben
File MIME type: application/javascript
File size: 1230 byte(s)
initial import
1 // DATA_TEMPLATE: js_data
2 oTest.fnStart( "oLanguage.sZeroRecords" );
3
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
7 "aaData": gaaData
8 } );
9 var oSettings = oTable.fnSettings();
10
11 oTest.fnTest(
12 "Zero records language is 'No matching records found' by default",
13 null,
14 function () { return oSettings.oLanguage.sZeroRecords == "No matching records found"; }
15 );
16
17 oTest.fnTest(
18 "Text is shown when empty table (after filtering)",
19 function () { oTable.fnFilter('nothinghere'); },
20 function () { return $('#example tbody tr td')[0].innerHTML == "No matching records found" }
21 );
22
23
24
25 oTest.fnTest(
26 "Zero records language can be defined",
27 function () {
28 oSession.fnRestore();
29 oTable = $('#example').dataTable( {
30 "aaData": gaaData,
31 "oLanguage": {
32 "sZeroRecords": "unit test"
33 }
34 } );
35 oSettings = oTable.fnSettings();
36 },
37 function () { return oSettings.oLanguage.sZeroRecords == "unit test"; }
38 );
39
40 oTest.fnTest(
41 "Text is shown when empty table (after filtering)",
42 function () { oTable.fnFilter('nothinghere2'); },
43 function () { return $('#example tbody tr td')[0].innerHTML == "unit test" }
44 );
45
46
47 oTest.fnComplete();
48 } );

  ViewVC Help
Powered by ViewVC 1.1.20