diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-05-09 12:52:00 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-05-09 12:52:00 -0400 |
commit | 5ae44f8a3bdd858aa95c79b5938566ca0a67f373 (patch) | |
tree | 13529ad454b7eb7ad4f79c855b4ca28a3bc14861 /tests/unit/tabs | |
parent | 0546cd57bbd0ccee25e96e1fb8be5f208b08dfd4 (diff) | |
download | jquery-ui-5ae44f8a3bdd858aa95c79b5938566ca0a67f373.tar.gz jquery-ui-5ae44f8a3bdd858aa95c79b5938566ca0a67f373.zip |
Tabs: Refactored spinner implementation. Fixes #7134 - Tabs: Deprecate spinner option.
Diffstat (limited to 'tests/unit/tabs')
-rw-r--r-- | tests/unit/tabs/tabs_deprecated.js | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/tests/unit/tabs/tabs_deprecated.js b/tests/unit/tabs/tabs_deprecated.js index 8d63409a8..0094bc4f7 100644 --- a/tests/unit/tabs/tabs_deprecated.js +++ b/tests/unit/tabs/tabs_deprecated.js @@ -106,34 +106,19 @@ test('cookie', function() { }); +asyncTest( "spinner", function() { + expect( 2 ); -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: '<img src="spinner.gif" alt="">', - 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); - } + var element = $( "#tabs2" ).tabs(); + + element.one( "tabsbeforeload", function( event, ui ) { + equals( element.find( ".ui-tabs-nav li:eq(2) em" ).length, 1, "beforeload" ); + }); + element.one( "tabsload", function( event, ui ) { + equals( element.find( ".ui-tabs-nav li:eq(2) em" ).length, 0, "load" ); + start(); }); + element.tabs( "option", "active", 2 ); }); test( "selected", function() { |