[Improvement] PullRefresh: add refersh event (#625)

This commit is contained in:
neverland
2018-02-08 10:38:34 +08:00
committed by GitHub
parent c2773b49a6
commit 6ed43f8c75
5 changed files with 55 additions and 42 deletions

View File

@@ -56,11 +56,15 @@ describe('PullRefresh', () => {
}
});
const refreshSpy = sinon.spy();
wrapper.vm.$on('refresh', refreshSpy);
wrapper.vm.$on('input', value => {
wrapper.vm.value = value;
setTimeout(() => {
wrapper.vm.value = false;
expect(refreshSpy.calledOnce).to.be.true;
setTimeout(() => {
expect(wrapper.vm.status).to.equal('normal');
done();