From 8fa9ed7cbc10d8fb1c37dde5d78c9041b20c3296 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 20 Jul 2010 20:51:09 -0400 Subject: [PATCH] Tabs: Added tests for select event. --- tests/unit/tabs/tabs_events.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/unit/tabs/tabs_events.js b/tests/unit/tabs/tabs_events.js index d0bc5fee2..1203d02df 100644 --- a/tests/unit/tabs/tabs_events.js +++ b/tests/unit/tabs/tabs_events.js @@ -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() { -- 2.39.5