Skip to content

Commit ffbafa3

Browse files
committed
Add unit test for reset event
1 parent cffb80c commit ffbafa3

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
@@ -125,4 +125,17 @@ describe('InfiniteLoading.vue', () => {
125125

126126
vm.$mount().$appendTo('body');
127127
});
128+
129+
it('should reset component and call onInfinite again', (done) => {
130+
let callCount = 0;
131+
vm.onInfinite = function test() {
132+
if (!callCount++) {
133+
this.$broadcast('$InfiniteLoading:reset');
134+
} else {
135+
done();
136+
}
137+
}.bind(vm);
138+
139+
vm.$mount().$appendTo('body');
140+
});
128141
});

0 commit comments

Comments
 (0)