diff options
Diffstat (limited to 'tests/unit/core/core.js')
-rw-r--r-- | tests/unit/core/core.js | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js index 1026c5b0b..5ebb9e9f4 100644 --- a/tests/unit/core/core.js +++ b/tests/unit/core/core.js @@ -2,7 +2,7 @@ module( "core - jQuery extensions" ); -TestHelpers.testJshint( "ui.core" ); +TestHelpers.testJshint( "core" ); test( "focus - original functionality", function() { expect( 1 ); @@ -28,6 +28,7 @@ asyncTest( "focus", function() { }); test( "zIndex", function() { + expect( 7 ); var el = $( "#zIndexAutoWithParent" ), parent = el.parent(); equal( el.zIndex(), 100, "zIndex traverses up to find value" ); @@ -46,6 +47,7 @@ test( "zIndex", function() { }); test( "innerWidth - getter", function() { + expect( 2 ); var el = $( "#dimensions" ); equal( el.innerWidth(), 122, "getter passthru" ); @@ -54,6 +56,7 @@ test( "innerWidth - getter", function() { }); test( "innerWidth - setter", function() { + expect( 2 ); var el = $( "#dimensions" ); el.innerWidth( 120 ); @@ -64,6 +67,7 @@ test( "innerWidth - setter", function() { }); test( "innerHeight - getter", function() { + expect( 2 ); var el = $( "#dimensions" ); equal( el.innerHeight(), 70, "getter passthru" ); @@ -72,6 +76,7 @@ test( "innerHeight - getter", function() { }); test( "innerHeight - setter", function() { + expect( 2 ); var el = $( "#dimensions" ); el.innerHeight( 60 ); @@ -82,6 +87,7 @@ test( "innerHeight - setter", function() { }); test( "outerWidth - getter", function() { + expect( 2 ); var el = $( "#dimensions" ); equal( el.outerWidth(), 140, "getter passthru" ); @@ -90,6 +96,7 @@ test( "outerWidth - getter", function() { }); test( "outerWidth - setter", function() { + expect( 2 ); var el = $( "#dimensions" ); el.outerWidth( 130 ); @@ -100,6 +107,7 @@ test( "outerWidth - setter", function() { }); test( "outerWidth(true) - getter", function() { + expect( 2 ); var el = $( "#dimensions" ); equal( el.outerWidth(true), 154, "getter passthru w/ margin" ); @@ -108,6 +116,7 @@ test( "outerWidth(true) - getter", function() { }); test( "outerWidth(true) - setter", function() { + expect( 2 ); var el = $( "#dimensions" ); el.outerWidth( 130, true ); @@ -118,6 +127,7 @@ test( "outerWidth(true) - setter", function() { }); test( "outerHeight - getter", function() { + expect( 2 ); var el = $( "#dimensions" ); equal( el.outerHeight(), 86, "getter passthru" ); @@ -126,6 +136,7 @@ test( "outerHeight - getter", function() { }); test( "outerHeight - setter", function() { + expect( 2 ); var el = $( "#dimensions" ); el.outerHeight( 80 ); @@ -136,6 +147,7 @@ test( "outerHeight - setter", function() { }); test( "outerHeight(true) - getter", function() { + expect( 2 ); var el = $( "#dimensions" ); equal( el.outerHeight(true), 98, "getter passthru w/ margin" ); @@ -144,6 +156,7 @@ test( "outerHeight(true) - getter", function() { }); test( "outerHeight(true) - setter", function() { + expect( 2 ); var el = $( "#dimensions" ); el.outerHeight( 90, true ); @@ -154,13 +167,20 @@ test( "outerHeight(true) - setter", function() { }); test( "uniqueId / removeUniqueId", function() { + expect( 3 ); var el = $( "img" ).eq( 0 ); - equal( el.attr( "id" ), undefined, "element has no initial id" ); + // support: jQuery <1.6.2 + // support: IE <8 + // We should use strictEqual( id, undefined ) when dropping jQuery 1.6.1 support (or IE6/7) + ok( !el.attr( "id" ), "element has no initial id" ); el.uniqueId(); ok( /ui-id-\d+$/.test( el.attr( "id" ) ), "element has generated id" ); el.removeUniqueId(); - equal( el.attr( "id" ), undefined, "unique id has been removed from element" ); + // support: jQuery <1.6.2 + // support: IE <8 + // see above + ok( !el.attr( "id" ), "unique id has been removed from element" ); }); })( jQuery ); |