From 5149c1b0dfae9c52904ce1b2840cf91027f1d314 Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Fri, 4 Dec 2009 18:24:45 -0600 Subject: [PATCH] Add a couple more layout tests. --- test/unit/fixtures/layout.html | 25 +++++++++++++++++++++++++ test/unit/layout_test.js | 7 +++++++ 2 files changed, 32 insertions(+) diff --git a/test/unit/fixtures/layout.html b/test/unit/fixtures/layout.html index 918e20c..5921e38 100644 --- a/test/unit/fixtures/layout.html +++ b/test/unit/fixtures/layout.html @@ -1,3 +1,5 @@ + +

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

@@ -16,6 +18,7 @@ +

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

@@ -30,6 +33,7 @@ } +
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. @@ -52,6 +56,7 @@ } +
@@ -79,6 +84,7 @@ } +
@@ -102,4 +108,23 @@ top: 30px; right: 10%; } + + + +
+
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +
+
+ + \ No newline at end of file diff --git a/test/unit/layout_test.js b/test/unit/layout_test.js index eec7187..46180c5 100644 --- a/test/unit/layout_test.js +++ b/test/unit/layout_test.js @@ -78,5 +78,12 @@ new Test.Unit.Runner({ this.assertEqual(60, layout.get('right'), 'right (percentage value)'); this.assertEqual(340, layout.get('left'), 'left'); + }, + + 'test positioning on absolutely-positioned element with top=0 and left=0': function() { + var layout = $('box6').getLayout(); + + this.assertEqual(0, layout.get('top'), 'top'); + this.assertIdentical($('box6_parent'), $('box6').getOffsetParent()); } }); \ No newline at end of file