aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2015-06-15 10:56:29 -0400
committerTimmy Willison <timmywillisn@gmail.com>2015-06-16 10:54:52 -0400
commit578dcee96a8d4d759b3a7e623177fa36a5133ba7 (patch)
tree97aea71790c74468a622a1e53e4f7c7a8903df6f /test
parente831856490d2212bdbaff4cd76137b93ccf26d92 (diff)
downloadjquery-578dcee96a8d4d759b3a7e623177fa36a5133ba7.tar.gz
jquery-578dcee96a8d4d759b3a7e623177fa36a5133ba7.zip
Revert "Offset: allow offset setter to throw for disconnected elements"
This reverts commit 0d11c1182f2012cd6eb06ce1e3fa5a495af9bee3.
Diffstat (limited to 'test')
-rw-r--r--test/unit/core.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index d8370637b..5a87e2f0c 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -36,6 +36,10 @@ test("jQuery()", function() {
expected++;
attrObj["width"] = 10;
}
+ if ( jQuery.fn.offset ) {
+ expected++;
+ attrObj["offset"] = { "top": 1, "left": 1 };
+ }
if ( jQuery.fn.css ) {
expected += 2;
attrObj["css"] = { "paddingLeft": 1, "paddingRight": 1 };
@@ -101,12 +105,16 @@ test("jQuery()", function() {
elem = jQuery("\n\n<em>world</em>")[0];
equal( elem.nodeName.toLowerCase(), "em", "leading newlines" );
- elem = jQuery( "<div/>", attrObj );
+ elem = jQuery("<div/>", attrObj );
if ( jQuery.fn.width ) {
equal( elem[0].style.width, "10px", "jQuery() quick setter width");
}
+ if ( jQuery.fn.offset ) {
+ equal( elem[0].style.top, "1px", "jQuery() quick setter offset");
+ }
+
if ( jQuery.fn.css ) {
equal( elem[0].style.paddingLeft, "1px", "jQuery quick setter css");
equal( elem[0].style.paddingRight, "1px", "jQuery quick setter css");