aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs/tabs_deprecated.js
diff options
context:
space:
mode:
authorDavid Petersen <public@petersendidit.com>2011-03-26 16:12:05 -0400
committerDavid Petersen <public@petersendidit.com>2011-03-26 21:00:45 -0400
commite5f081bc1c16c051665eafc22c9a7af3fba456c8 (patch)
tree3062b542da69ec209b2e905451be3ce68a72334e /tests/unit/tabs/tabs_deprecated.js
parente7971c9077ce1f8e4f9afb123118349544bf1acb (diff)
downloadjquery-ui-e5f081bc1c16c051665eafc22c9a7af3fba456c8.tar.gz
jquery-ui-e5f081bc1c16c051665eafc22c9a7af3fba456c8.zip
Tabs: Deprecate enable and disable events. Fixes #7142 Tabs: Deprecate enable and disable events
Diffstat (limited to 'tests/unit/tabs/tabs_deprecated.js')
-rw-r--r--tests/unit/tabs/tabs_deprecated.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/unit/tabs/tabs_deprecated.js b/tests/unit/tabs/tabs_deprecated.js
index cec689808..ee2dbdc74 100644
--- a/tests/unit/tabs/tabs_deprecated.js
+++ b/tests/unit/tabs/tabs_deprecated.js
@@ -41,4 +41,39 @@ test('spinner', function() {
});
});
+module("tabs (deprecated): enable/disable events");
+
+test('enable', function() {
+ expect(4);
+
+ var uiObj;
+ el = $('#tabs1').tabs({
+ disabled: [ 0, 1 ],
+ enable: function (event, ui) {
+ uiObj = ui;
+ }
+ });
+ el.tabs('enable', 1);
+ ok(uiObj !== undefined, 'trigger callback');
+ equals(uiObj.tab, $('a', el)[1], 'contain tab as DOM anchor element');
+ equals(uiObj.panel, $('div', el)[1], 'contain panel as DOM div element');
+ equals(uiObj.index, 1, 'contain index');
+});
+
+test('disable', function() {
+ expect(4);
+
+ var uiObj;
+ el = $('#tabs1').tabs({
+ disable: function (event, ui) {
+ uiObj = ui;
+ }
+ });
+ el.tabs('disable', 1);
+ ok(uiObj !== undefined, 'trigger callback');
+ equals(uiObj.tab, $('a', el)[1], 'contain tab as DOM anchor element');
+ equals(uiObj.panel, $('div', el)[1], 'contain panel as DOM div element');
+ equals(uiObj.index, 1, 'contain index');
+});
+
}( jQuery ) );