aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs/tabs_events.js
diff options
context:
space:
mode:
authorDavid Petersen <public@petersendidit.com>2011-02-07 19:32:32 -0500
committerScott González <scott.gonzalez@gmail.com>2011-02-15 08:56:19 -0500
commit8ef8d2d8772404ccd3587121de8365d44f791339 (patch)
treea448c25b84b8731bdf0ea1f14b2fb0b48d468b05 /tests/unit/tabs/tabs_events.js
parenta3cba34a4d99756e7590fee391fee1bdf06d8a5f (diff)
downloadjquery-ui-8ef8d2d8772404ccd3587121de8365d44f791339.tar.gz
jquery-ui-8ef8d2d8772404ccd3587121de8365d44f791339.zip
Tabs: Pass original event for show and select events. Fixes #5043 - Tabs: pass original event.
Diffstat (limited to 'tests/unit/tabs/tabs_events.js')
-rw-r--r--tests/unit/tabs/tabs_events.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/unit/tabs/tabs_events.js b/tests/unit/tabs/tabs_events.js
index 1203d02df..24fb62f9b 100644
--- a/tests/unit/tabs/tabs_events.js
+++ b/tests/unit/tabs/tabs_events.js
@@ -6,7 +6,9 @@
module("tabs: events");
test('select', function() {
- expect(6);
+ expect(7);
+
+ var eventObj;
el = $('#tabs1').tabs({
select: function(event, ui) {
ok(true, 'select triggered after initialization');
@@ -15,9 +17,13 @@ test('select', function() {
equals(ui.tab, el.find('a')[1], 'contain tab as DOM anchor element');
equals(ui.panel, el.find('div')[1], 'contain panel as DOM div element');
equals(ui.index, 1, 'contain index');
+ evenObj = event;
}
});
el.tabs('select', 1);
+
+ el.find( "li:eq(1) a" ).simulate( "click" );
+ equals( evenObj.originalEvent.type, "click", "select triggered by click" );
});
test('load', function() {
@@ -25,12 +31,13 @@ test('load', function() {
});
test('show', function() {
- expect(4);
+ expect(5);
- var uiObj;
+ var uiObj, eventObj;
el = $('#tabs1').tabs({
show: function(event, ui) {
uiObj = ui;
+ eventObj = event;
}
});
ok(uiObj !== undefined, 'trigger callback after initialization');
@@ -38,6 +45,9 @@ test('show', function() {
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" );
+
});
test('add', function() {