From f58c1efc11c7e4c20d792e485302eb480965f9a1 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Sun, 3 Jan 2016 17:46:01 -0500 Subject: [PATCH] Fixed failing tests in IE9/FX This fixes the two failing assertions that only triggered in IE 9 (no other versions) and Firefox. Both of them were caused by the offset for the dropdown including a constant extra amount, what appeared to be related to the size of the container if it actually had content. This was not consistent in browsers, so now we are forcing there to be a small amount of content within the container and then calculating the expected offset based on that height. --- tests/dropdown/positioning-tests.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/dropdown/positioning-tests.js b/tests/dropdown/positioning-tests.js index 98ff5f18..a17a5f1e 100644 --- a/tests/dropdown/positioning-tests.js +++ b/tests/dropdown/positioning-tests.js @@ -68,7 +68,7 @@ test('dropdown is positioned with static margins', function (assert) { marginLeft: '10px' }); - var $container = $(''); + var $container = $('test'); var container = new MockContainer(); $('#qunit-fixture').empty(); @@ -101,8 +101,8 @@ test('dropdown is positioned with static margins', function (assert) { dropdown._showDropdown(); assert.equal( - $dropdown.css('top'), - '5px', + $dropdown.css('top').substring(0, 2), + $container.outerHeight() + 5, 'The offset should be 5px at the top' ); @@ -123,7 +123,7 @@ test('dropdown is positioned with absolute offsets', function (assert) { left: '5px' }); - var $container = $(''); + var $container = $('test'); var container = new MockContainer(); $parent.appendTo($('#qunit-fixture')); @@ -154,8 +154,8 @@ test('dropdown is positioned with absolute offsets', function (assert) { dropdown._showDropdown(); assert.equal( - $dropdown.css('top'), - '0px', + $dropdown.css('top').substring(0, 2), + $container.outerHeight(), 'There should not be an extra top offset' );