Explorar el Código

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.
Kevin Brown hace 9 años
padre
commit
f58c1efc11
Se han modificado 1 ficheros con 6 adiciones y 6 borrados
  1. 6 6
      tests/dropdown/positioning-tests.js

+ 6 - 6
tests/dropdown/positioning-tests.js

@@ -68,7 +68,7 @@ test('dropdown is positioned with static margins', function (assert) {
         marginLeft: '10px'
     });
 
-    var $container = $('<span></span>');
+    var $container = $('<span>test</span>');
     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 = $('<span></span>');
+    var $container = $('<span>test</span>');
     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'
     );