X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Funit_testing%2Ftests_onhold%2F1_dom%2Fhtml-autodetect-sort.js;fp=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Funit_testing%2Ftests_onhold%2F1_dom%2Fhtml-autodetect-sort.js;h=c0f4ec50f667a7845075134e90a28b84376081e6;hb=b24a507278fc81ae8e7642d5eeedc35e58697d7c;hp=0000000000000000000000000000000000000000;hpb=fd9caa94da7b40958c8f8baac6c9719bd11d9ddb;p=proteocache.git diff --git a/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js new file mode 100755 index 0000000..c0f4ec5 --- /dev/null +++ b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/1_dom/html-autodetect-sort.js @@ -0,0 +1,57 @@ +// DATA_TEMPLATE: html_table +oTest.fnStart( "HTML auto detect" ); + +$(document).ready( function () { + var oTable = $('#example').dataTable(); + + oTest.fnTest( + "Initial sort", + null, + function () { + var ret = + $('#example tbody tr:eq(0) td:eq(0)').html() == '1' && + $('#example tbody tr:eq(1) td:eq(0)').html() == '2' && + $('#example tbody tr:eq(2) td:eq(0)').html() == '3'; + return ret; + } + ); + + oTest.fnTest( + "HTML sort", + function () { $('#example thead th:eq(1)').click() }, + function () { + var ret = + $('#example tbody tr:eq(0) td:eq(0)').html() == '2' && + $('#example tbody tr:eq(1) td:eq(0)').html() == '1' && + $('#example tbody tr:eq(2) td:eq(0)').html() == '4'; + return ret; + } + ); + + oTest.fnTest( + "HTML reverse sort", + function () { $('#example thead th:eq(1)').click() }, + function () { + var ret = + $('#example tbody tr:eq(0) td:eq(0)').html() == '3' && + $('#example tbody tr:eq(1) td:eq(0)').html() == '4' && + $('#example tbody tr:eq(2) td:eq(0)').html() == '1'; + return ret; + } + ); + + oTest.fnTest( + "Numeric sort", + function () { $('#example thead th:eq(0)').click() }, + function () { + var ret = + $('#example tbody tr:eq(0) td:eq(0)').html() == '1' && + $('#example tbody tr:eq(1) td:eq(0)').html() == '2' && + $('#example tbody tr:eq(2) td:eq(0)').html() == '3'; + return ret; + } + ); + + + oTest.fnComplete(); +} ); \ No newline at end of file