(function( $ ) { module("tabs (deprecated): core"); test( "#4581 - title attribute for remote tabs does not support foreign languages", function() { expect( 1 ); $( "#tabs2" ).tabs({ selected: 3, beforeload: function( event, ui ) { event.preventDefault(); equal( ui.panel.id, "∫ßáö_Սե", "proper title" ); } }); }); module("tabs (deprecated): options"); test('ajaxOptions', function() { ok(false, "missing test - untested code is broken code."); }); test('cache', function() { ok(false, "missing test - untested code is broken code."); }); test('idPrefix', function() { ok(false, "missing test - untested code is broken code."); }); test('tabTemplate', function() { ok(false, "missing test - untested code is broken code."); }); test('panelTemplate', function() { ok(false, "missing test - untested code is broken code."); }); test('spinner', function() { expect(4); stop(); el = $('#tabs2'); el.tabs({ selected: 2, load: function() { // spinner: default spinner setTimeout(function() { equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed"); equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed"); el.tabs('destroy'); el.tabs({ selected: 2, spinner: '', load: function() { // spinner: image equals($('li:eq(2) > a > span', el).length, 1, "should restore tab markup after spinner is removed"); equals($('li:eq(2) > a > span', el).html(), '3', "should restore tab label after spinner is removed"); start(); } }); }, 1); } }); }); module("tabs (deprecated): events"); test('enable', function() { expect(4); var uiObj; el = $('#tabs1').tabs({ disabled: [ 0, 1 ], enable: function (event, ui) { uiObj = ui; } }); el.tabs('enable', 1); ok(uiObj !== undefined, 'trigger callback'); equals(uiObj.tab, $('a', el)[1], 'contain tab as DOM anchor element'); equals(uiObj.panel, $('div', el)[1], 'contain panel as DOM div element'); equals(uiObj.index, 1, 'contain index'); }); test('disable', function() { expect(4); var uiObj; el = $('#tabs1').tabs({ disable: function (event, ui) { uiObj = ui; } }); el.tabs('disable', 1); ok(uiObj !== undefined, 'trigger callback'); equals(uiObj.tab, $('a', el)[1], 'contain tab as DOM anchor element'); equals(uiObj.panel, $('div', el)[1], 'contain panel as DOM div element'); equals(uiObj.index, 1, 'contain index'); }); test('add', function() { // TODO move to methods, not at all event related... var el = $('