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/oLanguage.sSearch.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.4 KB
Line 
1// DATA_TEMPLATE: js_data
2oTest.fnStart( "oLanguage.sSearch" );
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    "Search language is 'Search:' by default",
13    null,
14    function () { return oSettings.oLanguage.sSearch == "Search:"; }
15  );
16 
17  oTest.fnTest(
18    "Search language default is in the DOM",
19    null,
20    function () { return document.getElementById('example_filter').childNodes[0].nodeValue
21      == "Search: "; }
22  );
23 
24 
25  oTest.fnTest(
26    "Search language can be defined",
27    function () {
28      oSession.fnRestore();
29      oTable = $('#example').dataTable( {
30        "aaData": gaaData,
31        "oLanguage": {
32          "sSearch": "unit test"
33        }
34      } );
35      oSettings = oTable.fnSettings();
36    },
37    function () { return oSettings.oLanguage.sSearch == "unit test"; }
38  );
39 
40  oTest.fnTest(
41    "Info language definition is in the DOM",
42    null,
43    function () { return document.getElementById('example_filter').childNodes[0].nodeValue
44      == "unit test "; }
45  );
46 
47 
48  oTest.fnTest(
49    "Blank search has a no (separator) inserted",
50    function () {
51      oSession.fnRestore();
52      oTable = $('#example').dataTable( {
53        "aaData": gaaData,
54        "oLanguage": {
55          "sSearch": ""
56        }
57      } );
58      oSettings = oTable.fnSettings();
59    },
60    function () { return document.getElementById('example_filter').childNodes.length == 1; }
61  );
62 
63 
64  oTest.fnComplete();
65} );
Note: See TracBrowser for help on using the repository browser.