diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-04-29 20:13:34 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-04-29 20:22:52 -0400 |
commit | 24d978f8331a0b4e3bc4dc35eaa88a7f9a47c5fd (patch) | |
tree | db7a10c8e495a1cae283bfdcc1277992a5c29e71 | |
parent | eb9804bc99378bf56bf8159530463224853ddadc (diff) | |
download | jquery-ui-24d978f8331a0b4e3bc4dc35eaa88a7f9a47c5fd.tar.gz jquery-ui-24d978f8331a0b4e3bc4dc35eaa88a7f9a47c5fd.zip |
Core tests: Coding standards.
-rw-r--r-- | tests/unit/core/core.js | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js index 53415584f..79d1d4034 100644 --- a/tests/unit/core/core.js +++ b/tests/unit/core/core.js @@ -1,49 +1,44 @@ -/* - * core unit tests - */ -(function($) { +(function( $ ) { -module('core - jQuery extensions'); +module( "core - jQuery extensions" ); -test('focus - original functionality', function() { - expect(1); - - $('#inputTabindex0') +test( "focus - original functionality", function() { + expect( 1 ); + $( "#inputTabindex0" ) .focus(function() { - ok(true, 'event triggered'); + ok( true, "event triggered" ); }) .focus(); }); -asyncTest('focus', function() { - expect(2); - $('#inputTabindex0') +asyncTest( "focus", function() { + expect( 2 ); + $( "#inputTabindex0" ) .focus(function() { - ok(true, 'event triggered'); + ok( true, "event triggered" ); }) - .focus(500, function() { - ok(true, 'callback triggered'); - $(this).unbind('focus'); + .focus( 500, function() { + ok( true, "callback triggered" ); start(); }); }); -test('zIndex', function() { - var el = $('#zIndexAutoWithParent'), +test( "zIndex", function() { + 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'); + 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 = $( "#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'); + 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'); + equal( $( "#zIndexAutoNoParent" ).zIndex(), 0, "zIndex never explicitly set in hierarchy" ); }); test( "innerWidth - getter", function() { @@ -154,4 +149,4 @@ test( "outerHeight(true) - setter", function() { equal( el.height(), 32, "height set properly when hidden" ); }); -})(jQuery); +})( jQuery ); |