Skip to content

Commit c868434

Browse files
authored
Merge pull request #92 from yappbox/test/invalid-scroll-assertion
Add assertion to catch invalid scroll events in test
2 parents 5676d9b + bcd4c1e commit c868434

File tree

1 file changed

+3
-0
lines changed
  • addon/components/collection-scroll-view

1 file changed

+3
-0
lines changed

addon/components/collection-scroll-view/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { cached } from 'ember-cached-decorator-polyfill';
44
import { tracked } from '@glimmer/tracking';
55
import { action } from '@ember/object';
66
import { next, schedule } from '@ember/runloop';
7+
import { assert as emberAssert } from '@ember/debug';
78
import { ref } from 'ember-ref-bucket';
89

910
/* A component which integrates a ScrollView with ember-collection */
@@ -128,6 +129,8 @@ export default class CollectionScrollView extends Component {
128129
if (itemIndex >= 0) {
129130
let { y } = this.cellLayout.positionAt(itemIndex);
130131
scrollViewApi.scrollTo(y + this.headerHeight, true);
132+
} else {
133+
emberAssert(`item with ID ${id} not found`, false);
131134
}
132135
}
133136
}

0 commit comments

Comments
 (0)