X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Funit_testing%2Ftests_onhold%2F3_ajax%2FoLanguage.sUrl.js;fp=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Funit_testing%2Ftests_onhold%2F3_ajax%2FoLanguage.sUrl.js;h=5ebfe5ddcc873e398922ffbe0a52fd8af3cf11d4;hb=9bb6ee99ca7f738fac1087190b5481b8fe6e8d9f;hp=0000000000000000000000000000000000000000;hpb=2e3f6b76be585306f1003d849831840c0adb3360;p=proteocache.git diff --git a/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/3_ajax/oLanguage.sUrl.js b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/3_ajax/oLanguage.sUrl.js new file mode 100644 index 0000000..5ebfe5d --- /dev/null +++ b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/3_ajax/oLanguage.sUrl.js @@ -0,0 +1,62 @@ +// DATA_TEMPLATE: empty_table +oTest.fnStart( "oLanguage.sUrl" ); + +/* Note that we only test the internal storage of language information pulled form a file here + * as the other language tests will check it goes into the DOM correctly + */ + +$(document).ready( function () { + /* Check the default */ + var oTable = $('#example').dataTable( { + "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" + } ); + var oSettings = oTable.fnSettings(); + + oTest.fnTest( + "sUrl is blank by default", + null, + function () { return oSettings.oLanguage.sUrl == ""; } + ); + + + oTest.fnWaitTest( + "Loading of German file loads language information", + function () { + oSession.fnRestore(); + oTable = $('#example').dataTable( { + "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", + "oLanguage": { + "sUrl": "../../../examples/examples_support/de_DE.txt" + } + } ); + oSettings = oTable.fnSettings(); + }, + function () { + var bReturn = + oSettings.oLanguage.sProcessing == "Bitte warten..." && + oSettings.oLanguage.sLengthMenu == "_MENU_ Einträge anzeigen" && + oSettings.oLanguage.sZeroRecords == "Keine Einträge vorhanden." && + oSettings.oLanguage.sInfo == "_START_ bis _END_ von _TOTAL_ Einträgen" && + oSettings.oLanguage.sInfoEmpty == "0 bis 0 von 0 Einträgen" && + oSettings.oLanguage.sInfoFiltered == "(gefiltert von _MAX_ Einträgen)" && + oSettings.oLanguage.sInfoPostFix == "" && + oSettings.oLanguage.sSearch == "Suchen" && + oSettings.oLanguage.oPaginate.sFirst == "Erster" && + oSettings.oLanguage.oPaginate.sPrevious == "Zurück" && + oSettings.oLanguage.oPaginate.sNext == "Nächster" && + oSettings.oLanguage.oPaginate.sLast == "Letzter"; + + return bReturn; + } + ); + + /* One DOM check just to ensure that they go into the DOM */ + oTest.fnTest( + "Loaded language goes into the DOM", + null, + function () { return document.getElementById('example_info').innerHTML = "1 bis 10 von 57 Einträgen"; } + ); + + + oTest.fnComplete(); +} ); \ No newline at end of file