Skip to content

Commit ae8963f

Browse files
committed
Tabs: Rewrote some ticket tests and moved to approriate file.
1 parent d3e10de commit ae8963f

File tree

2 files changed

+16
-62
lines changed

2 files changed

+16
-62
lines changed

tests/unit/tabs/tabs_core.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ $.each({
2626
});
2727
});
2828

29+
// #5893 - Sublist in the tab list are considered as tab
30+
test( "nested list", function() {
31+
expect( 1 );
32+
33+
var element = $( "#tabs6" ).tabs();
34+
equals( element.data( "tabs" ).anchors.length, 2, "should contain 2 tab" );
35+
});
36+
37+
test( "disconnected from DOM", function() {
38+
expect( 2 );
39+
40+
var element = $( "#tabs1" ).remove().tabs();
41+
equals( element.find( ".ui-tabs-nav" ).length, 1, "should initialize nav" );
42+
equals( element.find( ".ui-tabs-panel" ).length, 3, "should initialize panels" );
43+
});
44+
2945
test( "aria-controls", function() {
3046
expect( 7 );
3147
var element = $( "#tabs1" ).tabs(),

tests/unit/tabs/tabs_tickets.js

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,6 @@
55

66
module("tabs: tickets");
77

8-
test('#2715 - id containing colon', function() {
9-
// http://dev.jqueryui.com/ticket/2715
10-
expect(4);
11-
12-
el = $('#tabs2').tabs();
13-
ok( $('div.ui-tabs-panel:eq(0)', '#tabs2').is(':visible'), 'first panel should be visible' );
14-
ok( $('div.ui-tabs-panel:eq(1)', '#tabs2').is(':hidden'), 'second panel should be hidden' );
15-
16-
el.tabs('option', 'active', 1).tabs('option', 'active', 0);
17-
ok( $('div.ui-tabs-panel:eq(0)', '#tabs2').is(':visible'), 'first panel should be visible' );
18-
ok( $('div.ui-tabs-panel:eq(1)', '#tabs2').is(':hidden'), 'second panel should be hidden' );
19-
20-
});
21-
22-
test('#???? - panel containing inline style', function() {
23-
expect(3);
24-
25-
var inlineStyle = function(property) {
26-
return $('#inline-style')[0].style[property];
27-
};
28-
var expected = inlineStyle('height');
29-
30-
el = $('#tabs2').tabs();
31-
equals(inlineStyle('height'), expected, 'init should not remove inline style');
32-
33-
el.tabs('option', 'active', 1);
34-
equals(inlineStyle('height'), expected, 'show tab should not remove inline style');
35-
36-
el.tabs('option', 'active', 0);
37-
equals(inlineStyle('height'), expected, 'hide tab should not remove inline style');
38-
39-
});
40-
418
test('#3627 - Ajax tab with url containing a fragment identifier fails to load', function() {
429
// http://dev.jqueryui.com/ticket/3627
4310
expect(1);
@@ -67,33 +34,4 @@ test('#4033 - IE expands hash to full url and misinterprets tab as ajax', functi
6734
equals($('a', el).attr('aria-controls'), 'tab', 'aria-contorls attribute is correct');
6835
});
6936

70-
test('#5893 - Sublist in the tab list are considered as tab', function() {
71-
// http://dev.jqueryui.com/ticket/5893
72-
expect(1);
73-
74-
el = $('#tabs6').tabs();
75-
equals(el.data("tabs").anchors.length, 2, 'should contain 2 tab');
76-
77-
});
78-
79-
test('#6710 - selectors are global', function() {
80-
// http://bugs.jqueryui.com/ticket/6710
81-
expect(1);
82-
83-
var container = $('\
84-
<div>\
85-
<div id="tabs_6710">\
86-
<ul>\
87-
<li><a href="#tabs-1_6710">Nunc tincidunt</a></li>\
88-
<li><a href="#tabs-2_6710">Proin dolor</a></li>\
89-
</ul>\
90-
<div id="tabs-1_6710"> <p>first</p> </div>\
91-
<div id="tabs-2_6710"> <p>second</p>\
92-
</div>\
93-
</div>');
94-
container.find('#tabs_6710').tabs();
95-
ok( container.find('#tabs-2_6710').is(':hidden'), 'should find panels and add corresponding classes' );
96-
});
97-
98-
9937
})(jQuery);

0 commit comments

Comments
 (0)