@@ -38,6 +38,7 @@ describe('vue-infinite-loading', () => {
38
38
list : [ ] ,
39
39
isDivScroll : false ,
40
40
direction : 'bottom' ,
41
+ spinner : 'default' ,
41
42
} ,
42
43
template : `
43
44
<div :style="{ overflow: isDivScroll ? 'auto' : 'visible' }">
@@ -48,6 +49,7 @@ describe('vue-infinite-loading', () => {
48
49
:direction="direction"
49
50
@infinite="infiniteHandler"
50
51
ref="infiniteLoading"
52
+ :spinner="spinner"
51
53
>
52
54
</infinite-loading>
53
55
</div>
@@ -147,12 +149,13 @@ describe('vue-infinite-loading', () => {
147
149
vm . $mount ( '#app' ) ;
148
150
} ) ;
149
151
150
- it ( 'should not trigger load again before the last load is complete\n (use div as the container)' , ( done ) => {
152
+ it ( 'should not trigger load again before the last load is complete\n (use div as the container and spiral spinner )' , ( done ) => {
151
153
vm = new Vue ( Object . assign ( { } , basicConfig , {
152
154
data : {
153
155
list : [ ] ,
154
156
isDivScroll : true ,
155
157
direction : 'bottom' ,
158
+ spinner : 'spiral' ,
156
159
} ,
157
160
methods : {
158
161
infiniteHandler : function infiniteHandler ( ) {
@@ -177,14 +180,15 @@ describe('vue-infinite-loading', () => {
177
180
vm . $mount ( '#app' ) ;
178
181
} ) ;
179
182
180
- it ( 'should works again when reset it after a completion\n (use top direction)' , ( done ) => {
183
+ it ( 'should works again when reset it after a completion\n (use top direction and bubbles spinner )' , ( done ) => {
181
184
let calledTimes = 0 ;
182
185
183
186
vm = new Vue ( Object . assign ( { } , basicConfig , {
184
187
data : {
185
188
list : [ ] ,
186
189
isDivScroll : false ,
187
190
direction : 'top' ,
191
+ spinner : 'bubbles' ,
188
192
} ,
189
193
methods : {
190
194
infiniteHandler : function infiniteHandler ( $state ) {
@@ -201,7 +205,7 @@ describe('vue-infinite-loading', () => {
201
205
} ) ;
202
206
} else if ( calledTimes === 2 ) {
203
207
// check spinner
204
- expect ( isShow ( this . $el . querySelector ( '.loading-default ' ) ) ) . to . be . true ;
208
+ expect ( isShow ( this . $el . querySelector ( '.loading-bubbles ' ) ) ) . to . be . true ;
205
209
done ( ) ;
206
210
}
207
211
} ,
@@ -211,14 +215,15 @@ describe('vue-infinite-loading', () => {
211
215
vm . $mount ( '#app' ) ;
212
216
} ) ;
213
217
214
- it ( 'should always load data until fill up the container\n (use div as the container)' , ( done ) => {
218
+ it ( 'should always load data until fill up the container\n (use div as the container and circles spinner )' , ( done ) => {
215
219
let timer ;
216
220
217
221
vm = new Vue ( Object . assign ( { } , basicConfig , {
218
222
data : {
219
223
list : [ ] ,
220
224
isDivScroll : true ,
221
225
direction : 'bottom' ,
226
+ spinner : 'circles' ,
222
227
} ,
223
228
methods : {
224
229
infiniteHandler : function infiniteHandler ( $state ) {
@@ -270,6 +275,7 @@ describe('vue-infinite-loading', () => {
270
275
list : [ ] ,
271
276
isDivScroll : true ,
272
277
direction : 'top' ,
278
+ spinner : 'default' ,
273
279
} ;
274
280
} ,
275
281
methods : {
@@ -380,12 +386,13 @@ describe('vue-infinite-loading', () => {
380
386
vm . $mount ( '#app' ) ;
381
387
} ) ;
382
388
383
- it ( 'should debounce properly for the scroll event handler\n (use div as the container)' , ( done ) => {
389
+ it ( 'should debounce properly for the scroll event handler\n (use div as the container and wave dots spinner )' , ( done ) => {
384
390
vm = new Vue ( Object . assign ( { } , basicConfig , {
385
391
data : {
386
392
list : [ ...new Array ( 20 ) . join ( '1' ) . split ( '' ) ] ,
387
393
isDivScroll : true ,
388
394
direction : 'bottom' ,
395
+ spinner : 'waveDots' ,
389
396
} ,
390
397
mounted : function mounted ( ) {
391
398
const scrollParent = this . $refs . infiniteLoading . scrollParent ;
0 commit comments