mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Core tests: Coding standards.
This commit is contained in:
parent
eb9804bc99
commit
24d978f833
@ -1,49 +1,44 @@
|
|||||||
/*
|
|
||||||
* core unit tests
|
|
||||||
*/
|
|
||||||
(function( $ ) {
|
(function( $ ) {
|
||||||
|
|
||||||
module('core - jQuery extensions');
|
module( "core - jQuery extensions" );
|
||||||
|
|
||||||
test('focus - original functionality', function() {
|
test( "focus - original functionality", function() {
|
||||||
expect( 1 );
|
expect( 1 );
|
||||||
|
$( "#inputTabindex0" )
|
||||||
$('#inputTabindex0')
|
|
||||||
.focus(function() {
|
.focus(function() {
|
||||||
ok(true, 'event triggered');
|
ok( true, "event triggered" );
|
||||||
})
|
})
|
||||||
.focus();
|
.focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
asyncTest('focus', function() {
|
asyncTest( "focus", function() {
|
||||||
expect( 2 );
|
expect( 2 );
|
||||||
$('#inputTabindex0')
|
$( "#inputTabindex0" )
|
||||||
.focus(function() {
|
.focus(function() {
|
||||||
ok(true, 'event triggered');
|
ok( true, "event triggered" );
|
||||||
})
|
})
|
||||||
.focus( 500, function() {
|
.focus( 500, function() {
|
||||||
ok(true, 'callback triggered');
|
ok( true, "callback triggered" );
|
||||||
$(this).unbind('focus');
|
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('zIndex', function() {
|
test( "zIndex", function() {
|
||||||
var el = $('#zIndexAutoWithParent'),
|
var el = $( "#zIndexAutoWithParent" ),
|
||||||
parent = el.parent();
|
parent = el.parent();
|
||||||
equal(el.zIndex(), 100, 'zIndex traverses up to find value');
|
equal( el.zIndex(), 100, "zIndex traverses up to find value" );
|
||||||
equal(parent.zIndex(200), parent, 'zIndex setter is chainable');
|
equal( parent.zIndex(200 ), parent, "zIndex setter is chainable" );
|
||||||
equal(el.zIndex(), 200, 'zIndex setter changed zIndex');
|
equal( el.zIndex(), 200, "zIndex setter changed zIndex" );
|
||||||
|
|
||||||
el = $('#zIndexAutoWithParentViaCSS');
|
el = $( "#zIndexAutoWithParentViaCSS" );
|
||||||
equal(el.zIndex(), 0, 'zIndex traverses up to find CSS value, not found because not positioned');
|
equal( el.zIndex(), 0, "zIndex traverses up to find CSS value, not found because not positioned" );
|
||||||
|
|
||||||
el = $('#zIndexAutoWithParentViaCSSPositioned');
|
el = $( "#zIndexAutoWithParentViaCSSPositioned" );
|
||||||
equal(el.zIndex(), 100, 'zIndex traverses up to find CSS value');
|
equal( el.zIndex(), 100, "zIndex traverses up to find CSS value" );
|
||||||
el.parent().zIndex( 200 );
|
el.parent().zIndex( 200 );
|
||||||
equal(el.zIndex(), 200, 'zIndex setter changed zIndex, overriding CSS');
|
equal( el.zIndex(), 200, "zIndex setter changed zIndex, overriding CSS" );
|
||||||
|
|
||||||
equal($('#zIndexAutoNoParent').zIndex(), 0, 'zIndex never explicitly set in hierarchy');
|
equal( $( "#zIndexAutoNoParent" ).zIndex(), 0, "zIndex never explicitly set in hierarchy" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test( "innerWidth - getter", function() {
|
test( "innerWidth - getter", function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user