aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-10 08:47:00 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-10 08:47:00 -0400
commita205c2c8b8498f82f87a723f49c1fe746e47c667 (patch)
treeaec316943c78a797739fe2c2def210e10dad4450 /tests/unit/tabs
parentbd6672d2571f69d5e2ed819e13514580648aaa13 (diff)
downloadjquery-ui-a205c2c8b8498f82f87a723f49c1fe746e47c667.tar.gz
jquery-ui-a205c2c8b8498f82f87a723f49c1fe746e47c667.zip
Tabs: Moved tests out of tickets file.
Diffstat (limited to 'tests/unit/tabs')
-rw-r--r--tests/unit/tabs/tabs.html1
-rw-r--r--tests/unit/tabs/tabs_core.js28
-rw-r--r--tests/unit/tabs/tabs_deprecated.html1
-rw-r--r--tests/unit/tabs/tabs_options.js2
-rw-r--r--tests/unit/tabs/tabs_tickets.js37
5 files changed, 29 insertions, 40 deletions
diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html
index 565a0b427..34ec28bc4 100644
--- a/tests/unit/tabs/tabs.html
+++ b/tests/unit/tabs/tabs.html
@@ -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 ) {
diff --git a/tests/unit/tabs/tabs_core.js b/tests/unit/tabs/tabs_core.js
index c9b16e3a8..98cb617ec 100644
--- a/tests/unit/tabs/tabs_core.js
+++ b/tests/unit/tabs/tabs_core.js
@@ -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 ) );
diff --git a/tests/unit/tabs/tabs_deprecated.html b/tests/unit/tabs/tabs_deprecated.html
index e71fea3d4..89d08f4d0 100644
--- a/tests/unit/tabs/tabs_deprecated.html
+++ b/tests/unit/tabs/tabs_deprecated.html
@@ -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>
diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js
index 97fd87bf6..8d61c47ef 100644
--- a/tests/unit/tabs/tabs_options.js
+++ b/tests/unit/tabs/tabs_options.js
@@ -210,4 +210,4 @@ test( "{ event: custom }", function() {
// TODO: add animation tests
-})(jQuery);
+}( jQuery ) );
diff --git a/tests/unit/tabs/tabs_tickets.js b/tests/unit/tabs/tabs_tickets.js
deleted file mode 100644
index d7a59cb5b..000000000
--- a/tests/unit/tabs/tabs_tickets.js
+++ /dev/null
@@ -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);