File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ describe('InfiniteLoading.vue', () => {
2121 isCustomSpinner : false ,
2222 listContainerHeight : 200 ,
2323 listItemHeight : 20 ,
24+ direction : 'bottom' ,
2425 } ,
2526 template : `
2627 <div style="margin: 0; padding: 0;"
@@ -34,6 +35,7 @@ describe('InfiniteLoading.vue', () => {
3435 }"></li>
3536 </ul>
3637 <infinite-loading :distance="distance"
38+ :direction="direction"
3739 :on-infinite="onInfinite"
3840 v-if="!isLoadedAll">
3941 <span slot="spinner" v-if="isCustomSpinner">
@@ -184,4 +186,16 @@ describe('InfiniteLoading.vue', () => {
184186
185187 expect ( vm . $el . querySelector ( '.custom-spinner' ) ) . to . be . ok ;
186188 } ) ;
189+
190+ it ( 'should load data when scroll top (direction attribute)' , ( done ) => {
191+ vm . direction = 'top' ;
192+ vm . onInfinite = function test ( ) {
193+ Vue . nextTick ( ( ) => {
194+ expect ( isShow ( vm . $el . querySelector ( '.loading-default' ) ) ) . to . be . true ;
195+ done ( ) ;
196+ } ) ;
197+ } ;
198+
199+ vm . $mount ( ) . $appendTo ( 'body' ) ;
200+ } ) ;
187201} ) ;
You can’t perform that action at this time.
0 commit comments