aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/core/core_deprecated.js
blob: f97b009a7f3fe1e4ebbfe2f6b49f87fd0f287d43 (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
(function( $ ) {

module( "core - deprecated" );

asyncTest( "focus - original functionality", function() {
	expect( 1 );
	$( "#inputTabindex0" )
		.one( "focus", function() {
			ok( true, "event triggered" );
			start();
		})
		.focus();
});

asyncTest( "focus", function() {
	expect( 2 );

	// support: IE 8
	// IE sometimes gets confused about what's focused if we don't explicitly
	// focus a different element first
	$( "body" ).focus();

	$( "#inputTabindex0" )
		.one( "focus", function() {
			ok( true, "event triggered" );
			start();
		})
		.focus( 500, function() {
			ok( true, "callback triggered" );
		});
});

test( "zIndex", function() {
	expect( 7 );
	var el = $( "#zIndexAutoWithParent" ),
		parent = el.parent();
	equal( el.zIndex(), 100, "zIndex traverses up to find value" );
	equal( parent.zIndex(200 ), parent, "zIndex setter is chainable" );
	equal( el.zIndex(), 200, "zIndex setter changed zIndex" );

	el = $( "#zIndexAutoWithParentViaCSS" );
	equal( el.zIndex(), 0, "zIndex traverses up to find CSS value, not found because not positioned" );

	el = $( "#zIndexAutoWithParentViaCSSPositioned" );
	equal( el.zIndex(), 100, "zIndex traverses up to find CSS value" );
	el.parent().zIndex( 200 );
	equal( el.zIndex(), 200, "zIndex setter changed zIndex, overriding CSS" );

	equal( $( "#zIndexAutoNoParent" ).zIndex(), 0, "zIndex never explicitly set in hierarchy" );
});

})( jQuery );