Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebApplication/MVC2/HeuristicLabWeb.PluginHost/HLWebPluginHost/Content/jQuery/jQueryPlugins/DataTables-1.7.6/media/unit_testing/tests_onhold/2_js/iDisplayLength.js @ 6286

Last change on this file since 6286 was 6286, checked in by dkahn, 13 years ago

#1198 Added jQuery plus plugins

File size: 1.6 KB
Line 
1// DATA_TEMPLATE: js_data
2oTest.fnStart( "iDisplayLength" );
3
4$(document).ready( function () {
5  /* Check the default */
6  $('#example').dataTable( {
7    "aaData": gaaData
8  } );
9 
10  oTest.fnTest(
11    "Default length is ten",
12    null,
13    function () { return $('#example tbody tr').length == 10; }
14  );
15 
16  oTest.fnTest(
17    "Select menu shows 10",
18    null,
19    function () { return $('#example_length select').val() == 10; }
20  );
21 
22 
23  oTest.fnTest(
24    "Set initial length to 25",
25    function () {
26      oSession.fnRestore();
27      $('#example').dataTable( {
28        "aaData": gaaData,
29        "iDisplayLength": 25
30      } );
31    },
32    function () { return $('#example tbody tr').length == 25; }
33  );
34 
35  oTest.fnTest(
36    "Select menu shows 25",
37    null,
38    function () { return $('#example_length select').val() == 25; }
39  );
40 
41 
42  oTest.fnTest(
43    "Set initial length to 100",
44    function () {
45      oSession.fnRestore();
46      $('#example').dataTable( {
47        "aaData": gaaData,
48        "iDisplayLength": 100
49      } );
50    },
51    function () { return $('#example tbody tr').length == 57; }
52  );
53 
54  oTest.fnTest(
55    "Select menu shows 25",
56    null,
57    function () { return $('#example_length select').val() == 100; }
58  );
59 
60 
61  oTest.fnTest(
62    "Set initial length to 23 (unknown select menu length)",
63    function () {
64      oSession.fnRestore();
65      $('#example').dataTable( {
66        "aaData": gaaData,
67        "iDisplayLength": 23
68      } );
69    },
70    function () { return $('#example tbody tr').length == 23; }
71  );
72 
73  oTest.fnTest(
74    "Select menu shows 10 (since 23 is unknow)",
75    null,
76    function () { return $('#example_length select').val() == 10; }
77  );
78 
79 
80  oTest.fnComplete();
81} );
Note: See TracBrowser for help on using the repository browser.