Skip to content

Commit f464357

Browse files
committed
Improve unit test for the top direction feature
1 parent 360bb5d commit f464357

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/unit/specs/InfiniteLoading.spec.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,19 @@ describe('InfiniteLoading.vue', () => {
204204
});
205205
});
206206

207+
it('should load data when scroll top with window (direction attribute)', (done) => {
208+
vm.isDivScroll = false;
209+
vm.direction = 'top';
210+
vm.onInfinite = function test() {
211+
Vue.nextTick(() => {
212+
expect(isShow(vm.$el.querySelector('.loading-default'))).to.be.true;
213+
done();
214+
});
215+
};
216+
217+
vm.$mount('#app');
218+
});
219+
207220
it('should load data when scroll top (direction attribute)', (done) => {
208221
vm.direction = 'top';
209222
vm.onInfinite = function test() {

0 commit comments

Comments
 (0)