/[projects]/misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/1_dom/html-autodetect-sort.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: 1400 byte(s)
initial import
1 // DATA_TEMPLATE: html_table
2 oTest.fnStart( "HTML auto detect" );
3
4 $(document).ready( function () {
5 var oTable = $('#example').dataTable();
6
7 oTest.fnTest(
8 "Initial sort",
9 null,
10 function () {
11 var ret =
12 $('#example tbody tr:eq(0) td:eq(0)').html() == '1' &&
13 $('#example tbody tr:eq(1) td:eq(0)').html() == '2' &&
14 $('#example tbody tr:eq(2) td:eq(0)').html() == '3';
15 return ret;
16 }
17 );
18
19 oTest.fnTest(
20 "HTML sort",
21 function () { $('#example thead th:eq(1)').click() },
22 function () {
23 var ret =
24 $('#example tbody tr:eq(0) td:eq(0)').html() == '2' &&
25 $('#example tbody tr:eq(1) td:eq(0)').html() == '1' &&
26 $('#example tbody tr:eq(2) td:eq(0)').html() == '4';
27 return ret;
28 }
29 );
30
31 oTest.fnTest(
32 "HTML reverse sort",
33 function () { $('#example thead th:eq(1)').click() },
34 function () {
35 var ret =
36 $('#example tbody tr:eq(0) td:eq(0)').html() == '3' &&
37 $('#example tbody tr:eq(1) td:eq(0)').html() == '4' &&
38 $('#example tbody tr:eq(2) td:eq(0)').html() == '1';
39 return ret;
40 }
41 );
42
43 oTest.fnTest(
44 "Numeric sort",
45 function () { $('#example thead th:eq(0)').click() },
46 function () {
47 var ret =
48 $('#example tbody tr:eq(0) td:eq(0)').html() == '1' &&
49 $('#example tbody tr:eq(1) td:eq(0)').html() == '2' &&
50 $('#example tbody tr:eq(2) td:eq(0)').html() == '3';
51 return ret;
52 }
53 );
54
55
56 oTest.fnComplete();
57 } );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20