diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/tabs/tabs_defaults.js | 4 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_defaults_deprecated.js | 1 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_deprecated.js | 20 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_events.js | 4 |
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; } |