]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Added tests for select event.
authorScott González <scott.gonzalez@gmail.com>
Wed, 21 Jul 2010 00:51:09 +0000 (20:51 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 21 Jul 2010 00:51:09 +0000 (20:51 -0400)
tests/unit/tabs/tabs_events.js

index d0bc5fee219c1ffdae642e132bb9d5945b2ecbd8..1203d02df11009622638b664cd2b4848c24ce04c 100644 (file)
@@ -6,7 +6,18 @@
 module("tabs: events");
 
 test('select', function() {
-       ok(false, "missing test - untested code is broken code.");
+       expect(6);
+       el = $('#tabs1').tabs({
+               select: function(event, ui) {
+                       ok(true, 'select triggered after initialization');
+                       equals(this, el[0], "context of callback");
+                       equals(event.type, 'tabsselect', 'event type in callback');
+                       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');
+               }
+       });
+       el.tabs('select', 1);
 });
 
 test('load', function() {