aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Petersen <public@petersendidit.com>2011-03-27 16:55:05 -0400
committerDavid Petersen <public@petersendidit.com>2011-03-27 16:55:05 -0400
commit787efd307aff11ad3c51a72f520c58b8158ae973 (patch)
tree737bb66e455e424c0c4a6cfe27edea0ebc652f6d /tests
parent9a00fd4c5ef637f29afc6debda4db136f1fcb3fb (diff)
downloadjquery-ui-787efd307aff11ad3c51a72f520c58b8158ae973.tar.gz
jquery-ui-787efd307aff11ad3c51a72f520c58b8158ae973.zip
Tabs: Rename show event to activate. Fixes #7137 Tabs: Rename show event to activate
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/tabs/tabs_defaults.js4
-rw-r--r--tests/unit/tabs/tabs_defaults_deprecated.js1
-rw-r--r--tests/unit/tabs/tabs_deprecated.js20
-rw-r--r--tests/unit/tabs/tabs_events.js4
4 files changed, 25 insertions, 4 deletions
diff --git a/tests/unit/tabs/tabs_defaults.js b/tests/unit/tabs/tabs_defaults.js
index 98cb99fb5..e155a3dac 100644
--- a/tests/unit/tabs/tabs_defaults.js
+++ b/tests/unit/tabs/tabs_defaults.js
@@ -3,6 +3,7 @@
*/
var tabs_defaults = {
+ activate: null,
beforeload: null,
collapsible: false,
cookie: null,
@@ -10,8 +11,7 @@ var tabs_defaults = {
event: "click",
fx: null,
load: null,
- select: null,
- show: null
+ select: null
};
// FAIL: falsy values break the cookie option
diff --git a/tests/unit/tabs/tabs_defaults_deprecated.js b/tests/unit/tabs/tabs_defaults_deprecated.js
index 73e9ffede..47fd75d8f 100644
--- a/tests/unit/tabs/tabs_defaults_deprecated.js
+++ b/tests/unit/tabs/tabs_defaults_deprecated.js
@@ -3,6 +3,7 @@
*/
var tabs_defaults = {
+ activate: null,
add: null,
ajaxOptions: null,
beforeload: null,
diff --git a/tests/unit/tabs/tabs_deprecated.js b/tests/unit/tabs/tabs_deprecated.js
index 8b6b50d7e..ba1a778b0 100644
--- a/tests/unit/tabs/tabs_deprecated.js
+++ b/tests/unit/tabs/tabs_deprecated.js
@@ -168,6 +168,26 @@ test('remove', function() {
ok(false, "missing test - untested code is broken code.");
});
+test('show', function() {
+ expect(5);
+
+ var uiObj, eventObj;
+ el = $('#tabs1').tabs({
+ show: function(event, ui) {
+ uiObj = ui;
+ eventObj = event;
+ }
+ });
+ ok(uiObj !== undefined, 'trigger callback after initialization');
+ equals(uiObj.tab, $('a', el)[0], 'contain tab as DOM anchor element');
+ equals(uiObj.panel, $('div', el)[0], 'contain panel as DOM div element');
+ equals(uiObj.index, 0, 'contain index');
+
+ el.find( "li:eq(1) a" ).simulate( "click" );
+ equals( eventObj.originalEvent.type, "click", "show triggered by click" );
+
+});
+
module("tabs (deprecated): methods");
test('add', function() {
diff --git a/tests/unit/tabs/tabs_events.js b/tests/unit/tabs/tabs_events.js
index 04f282157..60affd7ff 100644
--- a/tests/unit/tabs/tabs_events.js
+++ b/tests/unit/tabs/tabs_events.js
@@ -49,12 +49,12 @@ test('load', function() {
ok(false, "missing test - untested code is broken code.");
});
-test('show', function() {
+test('activate', function() {
expect(5);
var uiObj, eventObj;
el = $('#tabs1').tabs({
- show: function(event, ui) {
+ activate: function(event, ui) {
uiObj = ui;
eventObj = event;
}