Skip to content

Commit f58c1ef

Browse files
committed
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.
1 parent 09ecd3c commit f58c1ef

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/dropdown/positioning-tests.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ test('dropdown is positioned with static margins', function (assert) {
6868
marginLeft: '10px'
6969
});
7070

71-
var $container = $('<span></span>');
71+
var $container = $('<span>test</span>');
7272
var container = new MockContainer();
7373

7474
$('#qunit-fixture').empty();
@@ -101,8 +101,8 @@ test('dropdown is positioned with static margins', function (assert) {
101101
dropdown._showDropdown();
102102

103103
assert.equal(
104-
$dropdown.css('top'),
105-
'5px',
104+
$dropdown.css('top').substring(0, 2),
105+
$container.outerHeight() + 5,
106106
'The offset should be 5px at the top'
107107
);
108108

@@ -123,7 +123,7 @@ test('dropdown is positioned with absolute offsets', function (assert) {
123123
left: '5px'
124124
});
125125

126-
var $container = $('<span></span>');
126+
var $container = $('<span>test</span>');
127127
var container = new MockContainer();
128128

129129
$parent.appendTo($('#qunit-fixture'));
@@ -154,8 +154,8 @@ test('dropdown is positioned with absolute offsets', function (assert) {
154154
dropdown._showDropdown();
155155

156156
assert.equal(
157-
$dropdown.css('top'),
158-
'0px',
157+
$dropdown.css('top').substring(0, 2),
158+
$container.outerHeight(),
159159
'There should not be an extra top offset'
160160
);
161161

0 commit comments

Comments
 (0)