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

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/2_js/aoColumns.sTitle.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: 1928 byte(s)
initial import
1 // DATA_TEMPLATE: js_data
2 oTest.fnStart( "aoColumns.sTitle" );
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 "If not given, then the columns titles are empty",
13 null,
14 function () {
15 var jqNodes = $('#example thead tr:eq(0) th');
16 var bReturn =
17 jqNodes[0].innerHTML == "Rendering engine" &&
18 jqNodes[1].innerHTML == "Browser" &&
19 jqNodes[2].innerHTML == "Platform(s)" &&
20 jqNodes[3].innerHTML == "Engine version" &&
21 jqNodes[4].innerHTML == "CSS grade";
22 return bReturn;
23 }
24 );
25
26 oTest.fnTest(
27 "Can set a single column title - and others are read from DOM",
28 function () {
29 oSession.fnRestore();
30 $('#example').dataTable( {
31 "aaData": gaaData,
32 "aoColumns": [
33 null,
34 { "sTitle": 'unit test' },
35 null,
36 null,
37 null
38 ]
39 } );
40 },
41 function () {
42 var jqNodes = $('#example thead tr:eq(0) th');
43 var bReturn =
44 jqNodes[0].innerHTML == "Rendering engine" &&
45 jqNodes[1].innerHTML == "unit test" &&
46 jqNodes[2].innerHTML == "Platform(s)" &&
47 jqNodes[3].innerHTML == "Engine version" &&
48 jqNodes[4].innerHTML == "CSS grade";
49 return bReturn;
50 }
51 );
52
53 oTest.fnTest(
54 "Can set multiple column titles",
55 function () {
56 oSession.fnRestore();
57 $('#example').dataTable( {
58 "aaData": gaaData,
59 "aoColumns": [
60 null,
61 { "sTitle": 'unit test 1' },
62 null,
63 null,
64 { "sTitle": 'unit test 2' }
65 ]
66 } );
67 },
68 function () {
69 var jqNodes = $('#example thead tr:eq(0) th');
70 var bReturn =
71 jqNodes[0].innerHTML == "Rendering engine" &&
72 jqNodes[1].innerHTML == "unit test 1" &&
73 jqNodes[2].innerHTML == "Platform(s)" &&
74 jqNodes[3].innerHTML == "Engine version" &&
75 jqNodes[4].innerHTML == "unit test 2";
76 return bReturn;
77 }
78 );
79
80
81 oTest.fnComplete();
82 } );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20