Sha256: b459094d3fec9480ce69c89dccfe257e872fffb3d78fca1c5dba6c0f4e08acfa

Contents?: true

Size: 1.88 KB

Versions: 28

Compression:

Stored size: 1.88 KB

Contents

// DATA_TEMPLATE: js_data
oTest.fnStart( "aoColumns.sTitle" );

$(document).ready( function () {
	/* Check the default */
	var oTable = $('#example').dataTable( {
		"aaData": gaaData
	} );
	var oSettings = oTable.fnSettings();
	
	oTest.fnTest( 
		"If not given, then the columns titles are empty",
		null,
		function () {
			var jqNodes = $('#example thead tr:eq(0) th');
			var bReturn = 
				jqNodes[0].innerHTML == "Rendering engine" &&
				jqNodes[1].innerHTML == "Browser" &&
				jqNodes[2].innerHTML == "Platform(s)" &&
				jqNodes[3].innerHTML == "Engine version" &&
				jqNodes[4].innerHTML == "CSS grade";
			return bReturn;
		}
	);
	
	oTest.fnTest( 
		"Can set a single column title - and others are read from DOM",
		function () {
			oSession.fnRestore();
			$('#example').dataTable( {
				"aaData": gaaData,
				"aoColumns": [
					null,
					{ "sTitle": 'unit test' },
					null,
					null,
					null
				]
			} );
		},
		function () {
			var jqNodes = $('#example thead tr:eq(0) th');
			var bReturn = 
				jqNodes[0].innerHTML == "Rendering engine" &&
				jqNodes[1].innerHTML == "unit test" &&
				jqNodes[2].innerHTML == "Platform(s)" &&
				jqNodes[3].innerHTML == "Engine version" &&
				jqNodes[4].innerHTML == "CSS grade";
			return bReturn;
		}
	);
	
	oTest.fnTest( 
		"Can set multiple column titles",
		function () {
			oSession.fnRestore();
			$('#example').dataTable( {
				"aaData": gaaData,
				"aoColumns": [
					null,
					{ "sTitle": 'unit test 1' },
					null,
					null,
					{ "sTitle": 'unit test 2' }
				]
			} );
		},
		function () {
			var jqNodes = $('#example thead tr:eq(0) th');
			var bReturn = 
				jqNodes[0].innerHTML == "Rendering engine" &&
				jqNodes[1].innerHTML == "unit test 1" &&
				jqNodes[2].innerHTML == "Platform(s)" &&
				jqNodes[3].innerHTML == "Engine version" &&
				jqNodes[4].innerHTML == "unit test 2";
			return bReturn;
		}
	);
	
	
	oTest.fnComplete();
} );

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
classiccms-0.7.5 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.7.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.7.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.7.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.7.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.7.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.6.9 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.6.8 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.6.7 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.6.6 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.6.5 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.6.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.6.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.6.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.6.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.6.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.5.17 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.5.16 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.5.15 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
classiccms-0.5.14 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js