aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-04-04 17:06:13 -0400
committerScott González <scott.gonzalez@gmail.com>2011-04-04 17:06:13 -0400
commit995518c10fa03703754af3fe272fb1a7021a285b (patch)
tree75c8bac14e2b1aee0bfcbf0cdbde59ada23a0462 /tests/unit/tabs
parent1fc91f90d0dea2bbc6c84bfa994e21d120391782 (diff)
downloadjquery-ui-995518c10fa03703754af3fe272fb1a7021a285b.tar.gz
jquery-ui-995518c10fa03703754af3fe272fb1a7021a285b.zip
Tabs: cleanup.
Diffstat (limited to 'tests/unit/tabs')
-rw-r--r--tests/unit/tabs/tabs_defaults.js30
-rw-r--r--tests/unit/tabs/tabs_defaults_deprecated.js56
-rw-r--r--tests/unit/tabs/tabs_deprecated.js2
-rw-r--r--tests/unit/tabs/tabs_events.js7
-rw-r--r--tests/unit/tabs/tabs_tickets.js4
5 files changed, 45 insertions, 54 deletions
diff --git a/tests/unit/tabs/tabs_defaults.js b/tests/unit/tabs/tabs_defaults.js
index 0f33cc28c..d64316f9f 100644
--- a/tests/unit/tabs/tabs_defaults.js
+++ b/tests/unit/tabs/tabs_defaults.js
@@ -1,17 +1,13 @@
-/*
- * tabs_defaults.js
- */
-
-var tabs_defaults = {
- activate: null,
- beforeload: null,
- beforeActivate: null,
- collapsible: false,
- disabled: false,
- event: "click",
- fx: null,
- load: null
-};
-
-// FAIL: falsy values break the cookie option
-commonWidgetTests( "tabs", { defaults: tabs_defaults } );
+commonWidgetTests( "tabs", {
+ defaults: {
+ activate: null,
+// active: null,
+ beforeLoad: null,
+ beforeActivate: null,
+ collapsible: false,
+ disabled: false,
+ event: "click",
+ fx: null,
+ load: null
+ }
+});
diff --git a/tests/unit/tabs/tabs_defaults_deprecated.js b/tests/unit/tabs/tabs_defaults_deprecated.js
index 03ee13d3d..c496e72f5 100644
--- a/tests/unit/tabs/tabs_defaults_deprecated.js
+++ b/tests/unit/tabs/tabs_defaults_deprecated.js
@@ -1,30 +1,26 @@
-/*
- * tabs_defaults.js
- */
-
-var tabs_defaults = {
- activate: null,
- add: null,
- ajaxOptions: null,
- beforeload: null,
- beforeActivate: null,
- cache: false,
- collapsible: false,
- cookie: null,
- disable: null,
- disabled: false,
- enable: null,
- event: "click",
- fx: null,
- idPrefix: "ui-tabs-",
- load: null,
- panelTemplate: "<div></div>",
- remove: null,
- select: null,
- show: null,
- spinner: "<em>Loading&#8230;</em>",
- tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>"
-};
-
-// FAIL: falsy values break the cookie option
-commonWidgetTests( "tabs", { defaults: tabs_defaults } );
+commonWidgetTests( "tabs", {
+ defaults: {
+ activate: null,
+// active: null,
+ add: null,
+ ajaxOptions: null,
+ beforeLoad: null,
+ beforeActivate: null,
+ cache: false,
+ collapsible: false,
+ cookie: null,
+ disable: null,
+ disabled: false,
+ enable: null,
+ event: "click",
+ fx: null,
+ idPrefix: "ui-tabs-",
+ load: null,
+ panelTemplate: "<div></div>",
+ remove: null,
+ select: null,
+ show: null,
+ spinner: "<em>Loading&#8230;</em>",
+ tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>"
+ }
+});
diff --git a/tests/unit/tabs/tabs_deprecated.js b/tests/unit/tabs/tabs_deprecated.js
index b784c724e..c4a27026d 100644
--- a/tests/unit/tabs/tabs_deprecated.js
+++ b/tests/unit/tabs/tabs_deprecated.js
@@ -7,7 +7,7 @@ test( "#4581 - title attribute for remote tabs does not support foreign language
$( "#tabs2" ).tabs({
selected: 3,
- beforeload: function( event, ui ) {
+ beforeLoad: function( event, ui ) {
event.preventDefault();
equal( ui.panel.id, "∫ßáö_Սե", "proper title" );
}
diff --git a/tests/unit/tabs/tabs_events.js b/tests/unit/tabs/tabs_events.js
index c578e5db7..9c9fe0cd9 100644
--- a/tests/unit/tabs/tabs_events.js
+++ b/tests/unit/tabs/tabs_events.js
@@ -139,14 +139,14 @@ test( "activate", function() {
element.tabs( "option", "active", 1 );
});
-test('beforeload', function() {
+test( "beforeLoad", function() {
expect( 5 );
- el = $('#tabs2');
+ el = $( "#tabs2" );
el.tabs({
active: 2,
- beforeload: function( event, ui ) {
+ beforeLoad: function( event, ui ) {
ok( $.isFunction( ui.jqXHR.promise ), 'contain jqXHR object');
equals( ui.settings.url, "data/test.html", 'contain ajax settings url');
equals( ui.tab, el.find('a')[ 2 ], 'contain tab as DOM anchor element');
@@ -155,7 +155,6 @@ test('beforeload', function() {
event.preventDefault();
}
});
-
});
test('load', function() {
diff --git a/tests/unit/tabs/tabs_tickets.js b/tests/unit/tabs/tabs_tickets.js
index 36ddd6e84..503f96260 100644
--- a/tests/unit/tabs/tabs_tickets.js
+++ b/tests/unit/tabs/tabs_tickets.js
@@ -44,7 +44,7 @@ test('#3627 - Ajax tab with url containing a fragment identifier fails to load',
el = $('#tabs2').tabs({
active: 2,
- beforeload: function( event, ui ) {
+ beforeLoad: function( event, ui ) {
event.preventDefault();
ok(/test.html$/.test( ui.settings.url ), 'should ignore fragment identifier');
}
@@ -58,7 +58,7 @@ test('#4033 - IE expands hash to full url and misinterprets tab as ajax', functi
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 ) {
+ beforeLoad: function( event, ui ) {
event.preventDefault();
ok( false, 'should not be an ajax tab');
}