From ae8963f054902b44c8b510ed09ad941eb4e7f64f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 15 Apr 2011 11:04:49 -0400 Subject: [PATCH] Tabs: Rewrote some ticket tests and moved to approriate file. --- tests/unit/tabs/tabs_core.js | 16 +++++++++ tests/unit/tabs/tabs_tickets.js | 62 --------------------------------- 2 files changed, 16 insertions(+), 62 deletions(-) diff --git a/tests/unit/tabs/tabs_core.js b/tests/unit/tabs/tabs_core.js index 30d58c254..c9b16e3a8 100644 --- a/tests/unit/tabs/tabs_core.js +++ b/tests/unit/tabs/tabs_core.js @@ -26,6 +26,22 @@ $.each({ }); }); +// #5893 - Sublist in the tab list are considered as tab +test( "nested list", function() { + expect( 1 ); + + var element = $( "#tabs6" ).tabs(); + equals( element.data( "tabs" ).anchors.length, 2, "should contain 2 tab" ); +}); + +test( "disconnected from DOM", function() { + expect( 2 ); + + var element = $( "#tabs1" ).remove().tabs(); + equals( element.find( ".ui-tabs-nav" ).length, 1, "should initialize nav" ); + equals( element.find( ".ui-tabs-panel" ).length, 3, "should initialize panels" ); +}); + test( "aria-controls", function() { expect( 7 ); var element = $( "#tabs1" ).tabs(), diff --git a/tests/unit/tabs/tabs_tickets.js b/tests/unit/tabs/tabs_tickets.js index d65f0285a..d7a59cb5b 100644 --- a/tests/unit/tabs/tabs_tickets.js +++ b/tests/unit/tabs/tabs_tickets.js @@ -5,39 +5,6 @@ module("tabs: tickets"); -test('#2715 - id containing colon', function() { - // http://dev.jqueryui.com/ticket/2715 - expect(4); - - el = $('#tabs2').tabs(); - ok( $('div.ui-tabs-panel:eq(0)', '#tabs2').is(':visible'), 'first panel should be visible' ); - ok( $('div.ui-tabs-panel:eq(1)', '#tabs2').is(':hidden'), 'second panel should be hidden' ); - - el.tabs('option', 'active', 1).tabs('option', 'active', 0); - ok( $('div.ui-tabs-panel:eq(0)', '#tabs2').is(':visible'), 'first panel should be visible' ); - ok( $('div.ui-tabs-panel:eq(1)', '#tabs2').is(':hidden'), 'second panel should be hidden' ); - -}); - -test('#???? - panel containing inline style', function() { - expect(3); - - var inlineStyle = function(property) { - return $('#inline-style')[0].style[property]; - }; - var expected = inlineStyle('height'); - - el = $('#tabs2').tabs(); - equals(inlineStyle('height'), expected, 'init should not remove inline style'); - - el.tabs('option', 'active', 1); - equals(inlineStyle('height'), expected, 'show tab should not remove inline style'); - - el.tabs('option', 'active', 0); - equals(inlineStyle('height'), expected, 'hide tab should not remove inline style'); - -}); - test('#3627 - Ajax tab with url containing a fragment identifier fails to load', function() { // http://dev.jqueryui.com/ticket/3627 expect(1); @@ -67,33 +34,4 @@ test('#4033 - IE expands hash to full url and misinterprets tab as ajax', functi equals($('a', el).attr('aria-controls'), 'tab', 'aria-contorls attribute is correct'); }); -test('#5893 - Sublist in the tab list are considered as tab', function() { - // http://dev.jqueryui.com/ticket/5893 - expect(1); - - el = $('#tabs6').tabs(); - equals(el.data("tabs").anchors.length, 2, 'should contain 2 tab'); - -}); - -test('#6710 - selectors are global', function() { - // http://bugs.jqueryui.com/ticket/6710 - expect(1); - - var container = $('\ -
\ -
\ - \ -

first

\ -

second

\ -
\ -
'); - container.find('#tabs_6710').tabs(); - ok( container.find('#tabs-2_6710').is(':hidden'), 'should find panels and add corresponding classes' ); -}); - - })(jQuery); -- 2.39.5