@@ -79,13 +79,11 @@ describe('Stepper', () => {
|
||||
});
|
||||
|
||||
expect(wrapper.hasClass('van-stepper')).to.be.true;
|
||||
const eventStub = sinon.stub(wrapper.vm, '$emit');
|
||||
|
||||
wrapper.vm.value = 2;
|
||||
wrapper.update();
|
||||
wrapper.vm.$nextTick(() => {
|
||||
expect(eventStub.calledWith('input'));
|
||||
expect(eventStub.calledWith('change'));
|
||||
expect(wrapper.vm.currentValue).to.equal(2);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -135,4 +133,20 @@ describe('Stepper', () => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should not fire any event on props changed', (done) => {
|
||||
wrapper = mount(Stepper, {
|
||||
propsData: {
|
||||
value: 1
|
||||
}
|
||||
});
|
||||
const eventStub = sinon.stub(wrapper.vm, '$emit');
|
||||
|
||||
wrapper.vm.value = 2;
|
||||
wrapper.update();
|
||||
wrapper.vm.$nextTick(() => {
|
||||
expect(eventStub.called).to.be.false;
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user