Skip to content

Commit 2422604

Browse files
committed
Fix test
1 parent 238cfa7 commit 2422604

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/integration/components/scroll-indicators-test.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,17 @@ module('Integration | scroll indicators', function() {
134134
},
135135
});
136136

137+
let firstHeader = table.headers.objectAt(0);
138+
139+
// not necessarily 100px wide because of integer division
140+
let lastHeader = table.headers.objectAt(table.headers.length - 1);
141+
137142
assert.equal(
138143
table.isScrollIndicatorRendered('right'),
139144
true,
140145
'right scroll indicator is initially shown'
141146
);
142-
assert.ok(isOffset('right', 100), 'right scroll indicator is offset');
147+
assert.ok(isOffset('right', lastHeader.width), 'right scroll indicator is offset');
143148
assert.equal(
144149
table.isScrollIndicatorRendered('left'),
145150
false,
@@ -154,13 +159,13 @@ module('Integration | scroll indicators', function() {
154159
true,
155160
'right scroll indicator is shown during partial scroll'
156161
);
157-
assert.ok(isOffset('right', 100), 'right scroll indicator is offset');
162+
assert.ok(isOffset('right', lastHeader.width), 'right scroll indicator is offset');
158163
assert.equal(
159164
table.isScrollIndicatorRendered('left'),
160165
true,
161166
'left scroll indicator is shown during partial scroll'
162167
);
163-
assert.ok(isOffset('left', 100), 'left scroll indicator is offset');
168+
assert.ok(isOffset('left', firstHeader.width), 'left scroll indicator is offset');
164169

165170
// scroll horizontally to the end
166171
await scrollTo('[data-test-ember-table-overflow]', SCROLL_MAX, 0);
@@ -175,7 +180,7 @@ module('Integration | scroll indicators', function() {
175180
true,
176181
'left scroll indicator is still shown at end of scroll'
177182
);
178-
assert.ok(isOffset('left', 100), 'left scroll indicator is offset');
183+
assert.ok(isOffset('left', firstHeader.width), 'left scroll indicator is offset');
179184
});
180185

181186
test('top scroll indicator positioned below header', async function(assert) {

0 commit comments

Comments
 (0)