[Improvement] add utils test cases (#380)

This commit is contained in:
neverland
2017-12-05 21:32:02 +08:00
committed by GitHub
parent 5a17bc520a
commit df835618b0
9 changed files with 191 additions and 67 deletions
+4 -2
View File
@@ -64,7 +64,7 @@ describe('SubmitBar', () => {
}, 300);
});
it('can not submit when disabled', () => {
it('can not submit when disabled', (done) => {
wrapper = mount(SubmitBar, {
propsData: {
disabled: true,
@@ -77,10 +77,11 @@ describe('SubmitBar', () => {
wrapper.find('.van-button')[0].trigger('click');
setTimeout(() => {
expect(submitSpyFunc.calledOnce).to.be.false;
done();
}, 300);
});
it('can not submit when loading', () => {
it('can not submit when loading', (done) => {
wrapper = mount(SubmitBar, {
propsData: {
loading: true,
@@ -93,6 +94,7 @@ describe('SubmitBar', () => {
wrapper.find('.van-button')[0].trigger('click');
setTimeout(() => {
expect(submitSpyFunc.calledOnce).to.be.false;
done();
}, 300);
});
});