Tabs: Moved tests out of tickets file.

This commit is contained in:
Scott González 2011-05-10 08:47:00 -04:00
parent bd6672d257
commit a205c2c8b8
5 changed files with 29 additions and 40 deletions

View File

@ -24,7 +24,6 @@
<script src="tabs_events.js"></script>
<script src="tabs_methods.js"></script>
<script src="tabs_options.js"></script>
<script src="tabs_tickets.js"></script>
<script>
function tabs_state( tabs ) {

View File

@ -63,4 +63,32 @@ test( "accessibility", function() {
// TODO: add tests
});
test( "#3627 - Ajax tab with url containing a fragment identifier fails to load", function() {
expect( 1 );
var element = $( "#tabs2" ).tabs({
active: 2,
beforeLoad: function( event, ui ) {
event.preventDefault();
ok( /test.html$/.test( ui.ajaxSettings.url ), "should ignore fragment identifier" );
}
});
});
test( "#4033 - IE expands hash to full url and misinterprets tab as ajax", function() {
expect( 2 );
var element = $( "<div><ul><li><a href='#tab'>Tab</a></li></ul><div id='tab'></div></div>" );
element.appendTo( "#main" );
element.tabs({
beforeLoad: function( event, ui ) {
event.preventDefault();
ok( false, 'should not be an ajax tab');
}
});
equals( element.find( ".ui-tabs-nav a" ).attr( "aria-controls" ), "tab", "aria-contorls attribute is correct" );
tabs_state( element, 1 );
});
}( jQuery ) );

View File

@ -22,7 +22,6 @@
<script src="tabs_events.js"></script>
<script src="tabs_methods.js"></script>
<script src="tabs_options.js"></script>
<script src="tabs_tickets.js"></script>
<script src="tabs_deprecated.js"></script>
<script>

View File

@ -210,4 +210,4 @@ test( "{ event: custom }", function() {
// TODO: add animation tests
})(jQuery);
}( jQuery ) );

View File

@ -1,37 +0,0 @@
/*
* tabs_tickets.js
*/
(function($) {
module("tabs: tickets");
test('#3627 - Ajax tab with url containing a fragment identifier fails to load', function() {
// http://dev.jqueryui.com/ticket/3627
expect(1);
el = $('#tabs2').tabs({
active: 2,
beforeLoad: function( event, ui ) {
event.preventDefault();
ok(/test.html$/.test( ui.ajaxSettings.url ), 'should ignore fragment identifier');
}
});
});
test('#4033 - IE expands hash to full url and misinterprets tab as ajax', function() {
// http://dev.jqueryui.com/ticket/4033
expect(1);
el = $('<div><ul><li><a href="#tab">Tab</a></li></ul><div id="tab"></div></div>');
el.appendTo('#main');
el.tabs({
beforeLoad: function( event, ui ) {
event.preventDefault();
ok( false, 'should not be an ajax tab');
}
});
equals($('a', el).attr('aria-controls'), 'tab', 'aria-contorls attribute is correct');
});
})(jQuery);