Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmacleod committed Mar 19, 2021
1 parent 238cfa7 commit 2422604
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/integration/components/scroll-indicators-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ module('Integration | scroll indicators', function() {
},
});

let firstHeader = table.headers.objectAt(0);

// not necessarily 100px wide because of integer division
let lastHeader = table.headers.objectAt(table.headers.length - 1);

assert.equal(
table.isScrollIndicatorRendered('right'),
true,
'right scroll indicator is initially shown'
);
assert.ok(isOffset('right', 100), 'right scroll indicator is offset');
assert.ok(isOffset('right', lastHeader.width), 'right scroll indicator is offset');
assert.equal(
table.isScrollIndicatorRendered('left'),
false,
Expand All @@ -154,13 +159,13 @@ module('Integration | scroll indicators', function() {
true,
'right scroll indicator is shown during partial scroll'
);
assert.ok(isOffset('right', 100), 'right scroll indicator is offset');
assert.ok(isOffset('right', lastHeader.width), 'right scroll indicator is offset');
assert.equal(
table.isScrollIndicatorRendered('left'),
true,
'left scroll indicator is shown during partial scroll'
);
assert.ok(isOffset('left', 100), 'left scroll indicator is offset');
assert.ok(isOffset('left', firstHeader.width), 'left scroll indicator is offset');

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

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

0 comments on commit 2422604

Please sign in to comment.