aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/tabs/tabs_events.js
blob: 2c0eaac18972a2129fb4e020aebc95e741931db8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * tabs_events.js
 */
(function($) {

module("tabs: events");

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() {
	expect(4);

	var uiObj;
	el = $('#tabs1').tabs({
		show: function(event, ui) {
			uiObj = ui;
		}
	});
	ok(uiObj !== undefined, 'should fire show after init');
	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');
	equals(uiObj.index, 0, 'should have index');
	
});

test('add', function() {

	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');

});

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() {
	ok(false, "missing test - untested code is broken code.");
});

})(jQuery);