1
0
mirror of https://gitee.com/vant-contrib/vant.git synced 2025-04-06 03:57:59 +08:00
2018-12-14 14:24:23 +08:00

24 lines
503 B
JavaScript

import SubmitBar from '..';
import { mount } from '../../../test/utils';
test('submit', () => {
const wrapper = mount(SubmitBar, {
propsData: {
price: 0.01,
disabled: true
}
});
expect(wrapper).toMatchSnapshot();
// disabled
const button = wrapper.find('.van-button');
button.trigger('click');
expect(wrapper.emitted('submit')).toBeFalsy();
// submit
wrapper.vm.disabled = false;
button.trigger('click');
expect(wrapper.emitted('submit')).toBeTruthy();
});