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', () => {
21
21
isCustomSpinner : false ,
22
22
listContainerHeight : 200 ,
23
23
listItemHeight : 20 ,
24
+ direction : 'bottom' ,
24
25
} ,
25
26
template : `
26
27
<div style="margin: 0; padding: 0;"
@@ -34,6 +35,7 @@ describe('InfiniteLoading.vue', () => {
34
35
}"></li>
35
36
</ul>
36
37
<infinite-loading :distance="distance"
38
+ :direction="direction"
37
39
:on-infinite="onInfinite"
38
40
v-if="!isLoadedAll">
39
41
<span slot="spinner" v-if="isCustomSpinner">
@@ -184,4 +186,16 @@ describe('InfiniteLoading.vue', () => {
184
186
185
187
expect ( vm . $el . querySelector ( '.custom-spinner' ) ) . to . be . ok ;
186
188
} ) ;
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
+ } ) ;
187
201
} ) ;
You can’t perform that action at this time.
0 commit comments