2009-02-02 14:36:08 +00:00
|
|
|
/*
|
|
|
|
* tabs_events.js
|
|
|
|
*/
|
|
|
|
(function($) {
|
|
|
|
|
|
|
|
module("tabs: events");
|
|
|
|
|
2009-02-03 13:37:54 +00:00
|
|
|
test('select', function() {
|
|
|
|
ok(false, "missing test - untested code is broken code.");
|
|
|
|
});
|
|
|
|
|
|
|
|
test('load', function() {
|
|
|
|
ok(false, "missing test - untested code is broken code.");
|
|
|
|
});
|
|
|
|
|
|
|
|
test('show', function() {
|
2009-02-25 22:09:45 +00:00
|
|
|
expect(4);
|
2009-02-03 13:37:54 +00:00
|
|
|
|
|
|
|
var uiObj;
|
|
|
|
el = $('#tabs1').tabs({
|
|
|
|
show: function(event, ui) {
|
|
|
|
uiObj = ui;
|
|
|
|
}
|
|
|
|
});
|
2009-02-25 22:09:45 +00:00
|
|
|
ok(uiObj !== undefined, 'should fire show after init');
|
2009-02-03 13:37:54 +00:00
|
|
|
equals(uiObj.tab, $('#tabs1 a')[0], 'should have tab as DOM anchor element');
|
|
|
|
equals(uiObj.panel, $('#tabs1 div')[0], 'should have panel as DOM div element');
|
2009-02-25 22:09:45 +00:00
|
|
|
equals(uiObj.index, 0, 'should have index');
|
2009-02-03 13:37:54 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test('add', function() {
|
2009-12-31 13:43:54 +00:00
|
|
|
|
|
|
|
var el = $('<div id="tabs"><ul></ul></div>').tabs();
|
|
|
|
equals(el.tabs('option', 'selected'), -1, 'Initially empty, no selected tab');
|
|
|
|
|
|
|
|
el.tabs('add', '#test1', 'Test 1');
|
|
|
|
equals(el.tabs('option', 'selected'), 0, 'First tab added should be auto selected');
|
|
|
|
|
|
|
|
el.tabs('add', '#test2', 'Test 2');
|
|
|
|
equals(el.tabs('option', 'selected'), 0, 'Second tab added should not be auto selected');
|
|
|
|
|
2009-02-03 13:37:54 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test('remove', function() {
|
|
|
|
ok(false, "missing test - untested code is broken code.");
|
|
|
|
});
|
|
|
|
|
|
|
|
test('enable', function() {
|
|
|
|
ok(false, "missing test - untested code is broken code.");
|
|
|
|
});
|
|
|
|
|
|
|
|
test('disable', function() {
|
2009-02-02 14:36:08 +00:00
|
|
|
ok(false, "missing test - untested code is broken code.");
|
|
|
|
});
|
|
|
|
|
|
|
|
})(jQuery);
|