1 | /*
|
---|
2 | * tabs_events.js
|
---|
3 | */
|
---|
4 | (function($) {
|
---|
5 |
|
---|
6 | module("tabs: events");
|
---|
7 |
|
---|
8 | test('select', function() {
|
---|
9 | ok(false, "missing test - untested code is broken code.");
|
---|
10 | });
|
---|
11 |
|
---|
12 | test('load', function() {
|
---|
13 | ok(false, "missing test - untested code is broken code.");
|
---|
14 | });
|
---|
15 |
|
---|
16 | test('show', function() {
|
---|
17 | expect(4);
|
---|
18 |
|
---|
19 | var uiObj;
|
---|
20 | el = $('#tabs1').tabs({
|
---|
21 | show: function(event, ui) {
|
---|
22 | uiObj = ui;
|
---|
23 | }
|
---|
24 | });
|
---|
25 | ok(uiObj !== undefined, 'should fire show after init');
|
---|
26 | equals(uiObj.tab, $('#tabs1 a')[0], 'should have tab as DOM anchor element');
|
---|
27 | equals(uiObj.panel, $('#tabs1 div')[0], 'should have panel as DOM div element');
|
---|
28 | equals(uiObj.index, 0, 'should have index');
|
---|
29 |
|
---|
30 | });
|
---|
31 |
|
---|
32 | test('add', function() {
|
---|
33 |
|
---|
34 | var el = $('<div id="tabs"><ul></ul></div>').tabs();
|
---|
35 | equals(el.tabs('option', 'selected'), -1, 'Initially empty, no selected tab');
|
---|
36 |
|
---|
37 | el.tabs('add', '#test1', 'Test 1');
|
---|
38 | equals(el.tabs('option', 'selected'), 0, 'First tab added should be auto selected');
|
---|
39 |
|
---|
40 | el.tabs('add', '#test2', 'Test 2');
|
---|
41 | equals(el.tabs('option', 'selected'), 0, 'Second tab added should not be auto selected');
|
---|
42 |
|
---|
43 | });
|
---|
44 |
|
---|
45 | test('remove', function() {
|
---|
46 | ok(false, "missing test - untested code is broken code.");
|
---|
47 | });
|
---|
48 |
|
---|
49 | test('enable', function() {
|
---|
50 | ok(false, "missing test - untested code is broken code.");
|
---|
51 | });
|
---|
52 |
|
---|
53 | test('disable', function() {
|
---|
54 | ok(false, "missing test - untested code is broken code.");
|
---|
55 | });
|
---|
56 |
|
---|
57 | })(jQuery);
|
---|