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 @@ -19,6 +19,7 @@ describe('InfiniteLoading.vue', () => {
19
19
isCustomSpinner : false ,
20
20
listContainerHeight : 200 ,
21
21
listItemHeight : 20 ,
22
+ direction : 'bottom' ,
22
23
} ;
23
24
} ,
24
25
render ( createElement ) {
@@ -46,6 +47,7 @@ describe('InfiniteLoading.vue', () => {
46
47
props : {
47
48
distance : this . distance ,
48
49
onInfinite : this . onInfinite ,
50
+ direction : this . direction ,
49
51
} ,
50
52
ref : 'infiniteLoading' ,
51
53
} ,
@@ -217,4 +219,16 @@ describe('InfiniteLoading.vue', () => {
217
219
218
220
expect ( vm . $el . querySelector ( '.custom-spinner' ) ) . to . be . ok ;
219
221
} ) ;
222
+
223
+ it ( 'should load data when scroll top (direction attribute)' , ( done ) => {
224
+ vm . direction = 'top' ;
225
+ vm . onInfinite = function test ( ) {
226
+ Vue . nextTick ( ( ) => {
227
+ expect ( isShow ( vm . $el . querySelector ( '.loading-default' ) ) ) . to . be . true ;
228
+ done ( ) ;
229
+ } ) ;
230
+ } ;
231
+
232
+ vm . $mount ( '#app' ) ;
233
+ } ) ;
220
234
} ) ;
You can’t perform that action at this time.
0 commit comments