Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scroll to bottom test #653

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions tests/integration/components/light-table-occlusion-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,25 @@ module('Integration | Component | light table | occlusion', function(hooks) {
assert.equal(find('*').textContent.trim(), '');
});

test('takes 50 rows, renders some rows with scrollbar and occludes the rest', async function(assert) {
assert.expect(3);
test('scrolled to bottom', async function(assert) {
assert.expect(4);

this.set('table', new Table(Columns, this.server.createList('user', 50)));

this.set('onScrolledToBottom', () => {
assert.ok(true);
});

await render(hbs `
{{#light-table table height='40vh' occlusion=true estimatedRowHeight=30 as |t|}}
{{t.head fixed=true}}
{{t.body}}
{{t.body onScrolledToBottom=(action onScrolledToBottom)}}
{{/light-table}}
`);

assert.ok(findAll('.vertical-collection tbody.lt-body tr.lt-row').length < 30, 'only some rows are rendered');

let scrollContainer = 'vertical-collection';
let scrollContainer = '.lt-scrollable.tse-scrollable.vertical-collection';
let { scrollHeight } = find(scrollContainer);

assert.ok(findAll(scrollContainer).length > 0, 'scroll container was rendered');
Expand Down