[Improvement] upgrade to jest-serializer-vue@2.0 (#1215)
This commit is contained in:
@@ -19,5 +19,5 @@ test('callback events', () => {
|
||||
expect(callback.mock.calls.length).toBe(1);
|
||||
expect(wrapper.emitted('cancel')).toBeTruthy();
|
||||
expect(wrapper.emitted('input')[0][0]).toBeFalsy();
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -13,23 +13,23 @@ it('drag and show left part', () => {
|
||||
const wrapper = mount(CellSwipe, defaultProps);
|
||||
|
||||
triggerDrag(wrapper, 10, 0);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
triggerDrag(wrapper, 50, 0);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
triggerDrag(wrapper, 500, 0);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
triggerDrag(wrapper, 0, 100);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('drag and show left part', () => {
|
||||
const wrapper = mount(CellSwipe, defaultProps);
|
||||
|
||||
triggerDrag(wrapper, -50, 0);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('on close prop', () => {
|
||||
|
||||
@@ -28,7 +28,7 @@ describe('ContactCard', () => {
|
||||
describe('ContactList', () => {
|
||||
test('render', () => {
|
||||
const wrapper = mount(ContactList);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ test('exchange coupon', () => {
|
||||
|
||||
test('coupon cell', () => {
|
||||
const wrapper = mount(CouponCell);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
wrapper.setProps({
|
||||
coupons: [{ value: 100 }],
|
||||
chosenCoupon: 0
|
||||
});
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -62,7 +62,7 @@ test('render textarea', done => {
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@ test('render image', () => {
|
||||
propsData: { images }
|
||||
});
|
||||
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
const swipe = wrapper.find('.van-swipe__track');
|
||||
triggerDrag(swipe, 500, 0);
|
||||
|
||||
@@ -111,12 +111,12 @@ test('column watch default index', () => {
|
||||
}
|
||||
});
|
||||
wrapper.vm.options = [disabled, ...simpleColumn];
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
wrapper.vm.options = [disabled, ...simpleColumn];
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
wrapper.vm.options = [1, disabled, disabled, disabled];
|
||||
wrapper.vm.defaultIndex = 2;
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@ test('reset z-index', () => {
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('popup lock scroll', () => {
|
||||
|
||||
@@ -8,9 +8,9 @@ test('calc width', () => {
|
||||
percentage: 100
|
||||
}
|
||||
});
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
wrapper.vm.showPivot = true;
|
||||
wrapper.vm.pivotText = 'test';
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -18,26 +18,26 @@ test('change head content when pulling down', () => {
|
||||
// pulling
|
||||
trigger(track, 'touchstart', 0, 0);
|
||||
trigger(track, 'touchmove', 0, 10);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
// loosing
|
||||
trigger(track, 'touchmove', 0, 100);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
// loading
|
||||
trigger(track, 'touchend', 0, 100);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
// still loading
|
||||
triggerDrag(track, 0, 100);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
expect(wrapper.emitted('input')).toBeTruthy();
|
||||
expect(wrapper.emitted('refresh')).toBeTruthy();
|
||||
|
||||
// end loading
|
||||
wrapper.vm.value = false;
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('pull a short distance', () => {
|
||||
@@ -67,5 +67,5 @@ test('not in page top', () => {
|
||||
window.scrollTop = 0;
|
||||
trigger(track, 'touchmove', 0, 100);
|
||||
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -19,11 +19,11 @@ test('drag button', () => {
|
||||
|
||||
const button = wrapper.find('.van-slider__button');
|
||||
triggerDrag(button, 50, 0);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
wrapper.setData({ disabled: false });
|
||||
triggerDrag(button, 50, 0);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('click bar', () => {
|
||||
@@ -39,9 +39,9 @@ it('click bar', () => {
|
||||
});
|
||||
|
||||
trigger(wrapper, 'click', 100, 0);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
wrapper.setData({ disabled: false });
|
||||
trigger(wrapper, 'click', 100, 0);
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ test('disabled stepper', () => {
|
||||
disabled: true
|
||||
}
|
||||
});
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('disable stepper input', () => {
|
||||
@@ -16,7 +16,7 @@ test('disable stepper input', () => {
|
||||
disableInput: true
|
||||
}
|
||||
});
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('click button', () => {
|
||||
|
||||
@@ -9,7 +9,7 @@ test('submit', () => {
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
// disabled
|
||||
const button = wrapper.find('.van-button');
|
||||
|
||||
@@ -2,7 +2,7 @@ import TreeSelect from '../';
|
||||
import { mount } from '@vue/test-utils';
|
||||
|
||||
test('empty list', () => {
|
||||
expect(mount(TreeSelect).html()).toMatchSnapshot();
|
||||
expect(mount(TreeSelect)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('select item', () => {
|
||||
|
||||
Reference in New Issue
Block a user