diff --git a/src/action-bar/test/index.spec.js b/src/action-bar/test/index.spec.js index d64a5f25d..39e18b18d 100644 --- a/src/action-bar/test/index.spec.js +++ b/src/action-bar/test/index.spec.js @@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'; test('should allow to disable safe-area-inset-bottom prop', () => { const wrapper = mount(ActionBar, { - propsData: { + props: { safeAreaInsetBottom: false, }, }); diff --git a/src/action-sheet/test/index.spec.js b/src/action-sheet/test/index.spec.js index de3266abd..5b3d47237 100644 --- a/src/action-sheet/test/index.spec.js +++ b/src/action-sheet/test/index.spec.js @@ -4,7 +4,7 @@ import ActionSheet from '..'; test('should emit select event after clicking option', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, actions: [{ name: 'Option' }], }, @@ -18,7 +18,7 @@ test('should emit select event after clicking option', () => { test('should call callback function after clicking option', () => { const callback = jest.fn(); const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, actions: [{ name: 'Option', callback }], }, @@ -30,7 +30,7 @@ test('should call callback function after clicking option', () => { test('should not emit select event after clicking loading option', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, actions: [{ name: 'Option', loading: true }], }, @@ -42,7 +42,7 @@ test('should not emit select event after clicking loading option', () => { test('should not emit select event after clicking disabled option', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, actions: [{ name: 'Option', disabled: true }], }, @@ -54,7 +54,7 @@ test('should not emit select event after clicking disabled option', () => { test('should emit cancel event after clicking cancel button', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, actions: [{ name: 'Option' }], cancelText: 'Cancel', @@ -67,7 +67,7 @@ test('should emit cancel event after clicking cancel button', () => { test('should render subname and match snapshot', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, actions: [{ name: 'Option', subname: 'Subname' }], cancelText: 'Cancel', @@ -103,7 +103,7 @@ test('should render default slot and match snapshot', () => { test('should allow to use the teleport prop', () => { const root = document.createElement('div'); mount(ActionSheet, { - propsData: { + props: { show: true, teleport: root, }, @@ -114,7 +114,7 @@ test('should allow to use the teleport prop', () => { test('should have "van-popup--round" class when setting the round prop', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, round: true, }, @@ -125,7 +125,7 @@ test('should have "van-popup--round" class when setting the round prop', () => { test('should change option color when using the color prop', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, actions: [{ name: 'Option', color: 'red' }], }, @@ -138,7 +138,7 @@ test('should change option color when using the color prop', () => { test('should hide close icon when the closeable prop is false', async () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, title: 'Title', }, @@ -153,7 +153,7 @@ test('should hide close icon when the closeable prop is false', async () => { test('should allow to custom close icon with closeIcon prop', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, title: 'Title', closeIcon: 'cross', @@ -165,7 +165,7 @@ test('should allow to custom close icon with closeIcon prop', () => { test('should render description and match snapshot', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, description: 'This is a description', }, @@ -178,7 +178,7 @@ test('should render description and match snapshot', () => { test('should render description slot when match snapshot', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, }, slots: { @@ -193,7 +193,7 @@ test('should render description slot when match snapshot', () => { test('should close after clicking option if close-on-click-action prop is true', () => { const wrapper = mount(ActionSheet, { - propsData: { + props: { show: true, actions: [{ name: 'Option' }], closeOnClickAction: true, diff --git a/src/address-edit/test/index.legacy.js b/src/address-edit/test/index.legacy.js index 0052e2ebb..95651b2b0 100644 --- a/src/address-edit/test/index.legacy.js +++ b/src/address-edit/test/index.legacy.js @@ -16,7 +16,7 @@ const addressInfo = { const createComponent = () => { const wrapper = mount(AddressEdit, { - propsData: { + props: { areaList, addressInfo, showPostal: true, @@ -43,7 +43,7 @@ test('create a AddressEdit', () => { test('create a AddressEdit with props', () => { const wrapper = mount(AddressEdit, { - propsData: { + props: { areaList, addressInfo, showPostal: true, @@ -57,7 +57,7 @@ test('create a AddressEdit with props', () => { test('valid area placeholder confirm', async () => { const wrapper = mount(AddressEdit, { - propsData: { + props: { areaList, areaColumnsPlaceholder: ['请选择', '请选择', '请选择'], }, @@ -96,7 +96,7 @@ test('set-default', () => { test('validator props', async () => { const wrapper = mount(AddressEdit, { - propsData: { + props: { areaList, validator(key, value) { return `${key}${value}`; @@ -192,7 +192,7 @@ test('watch address info', () => { test('set/get area code', async () => { const wrapper = mount(AddressEdit, { - propsData: { areaList }, + props: { areaList }, }); expect(wrapper.vm.getArea()).toEqual([ @@ -218,7 +218,7 @@ test('set/get area code', async () => { test('watch area code', async () => { const wrapper = mount(AddressEdit, { - propsData: { + props: { areaList: {}, addressInfo: { areaCode: '110101', @@ -235,7 +235,7 @@ test('watch area code', async () => { test('show search result', async () => { const wrapper = mount(AddressEdit, { - propsData: { + props: { showSearchResult: true, searchResult: [ { name: 'name1', address: 'address1' }, @@ -265,7 +265,7 @@ test('show search result', async () => { test('delete address', async () => { const wrapper = mount(AddressEdit, { attachToDocument: true, - propsData: { + props: { showDelete: true, }, }); @@ -297,7 +297,7 @@ test('select area', () => { test('click-area event', () => { const wrapper = mount(AddressEdit, { - propsData: { + props: { disableArea: true, }, }); @@ -309,7 +309,7 @@ test('click-area event', () => { test('tel-maxlength prop', () => { const wrapper = mount(AddressEdit, { - propsData: { + props: { telMaxlength: 4, }, }); diff --git a/src/address-list/test/index.legacy.js b/src/address-list/test/index.legacy.js index b749e4d54..613691a38 100644 --- a/src/address-list/test/index.legacy.js +++ b/src/address-list/test/index.legacy.js @@ -18,7 +18,7 @@ const list = [ test('unswitchable', () => { const wrapper = mount(AddressList, { - propsData: { + props: { list, switchable: false, }, @@ -30,7 +30,7 @@ test('unswitchable', () => { test('select event', () => { const onSelect = jest.fn(); const wrapper = mount(AddressList, { - propsData: { + props: { list, }, context: { @@ -48,7 +48,7 @@ test('select event', () => { test('click-item event', () => { const onClickItem = jest.fn(); const wrapper = mount(AddressList, { - propsData: { + props: { list, }, context: { diff --git a/src/area/test/index.legacy.js b/src/area/test/index.legacy.js index ec4ee113a..c6c1f41e1 100644 --- a/src/area/test/index.legacy.js +++ b/src/area/test/index.legacy.js @@ -18,7 +18,7 @@ test('confirm & cancel event', async () => { const onConfirm = jest.fn(); const onCancel = jest.fn(); const wrapper = mount(Area, { - propsData: { + props: { areaList, }, listeners: { @@ -38,7 +38,7 @@ test('confirm & cancel event', async () => { test('watch areaList & code', async () => { const wrapper = mount(Area, { - propsData: { + props: { areaList, }, }); @@ -58,7 +58,7 @@ test('watch areaList & code', async () => { test('change option', () => { const onChange = jest.fn(); const wrapper = mount(Area, { - propsData: { + props: { areaList, }, listeners: { @@ -82,7 +82,7 @@ test('change option', () => { test('getValues method', () => { const wrapper = mount(Area, { - propsData: { + props: { areaList, }, created() { @@ -95,7 +95,7 @@ test('getValues method', () => { test('reset method', async () => { const wrapper = mount(Area, { - propsData: { + props: { areaList, value: '120225', }, @@ -109,7 +109,7 @@ test('reset method', async () => { test('columns-num prop', async () => { const wrapper = mount(Area, { - propsData: { + props: { areaList, columnsNum: 3, }, diff --git a/src/badge/test/index.spec.js b/src/badge/test/index.spec.js index 371a11c00..61f286b60 100644 --- a/src/badge/test/index.spec.js +++ b/src/badge/test/index.spec.js @@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'; test('should render nothing when badge is empty string', () => { const wrapper = mount(Badge, { - propsData: { + props: { badge: '', }, }); @@ -13,7 +13,7 @@ test('should render nothing when badge is empty string', () => { test('should render nothing when badge is undefined', () => { const wrapper = mount(Badge, { - propsData: { + props: { badge: undefined, }, }); @@ -23,7 +23,7 @@ test('should render nothing when badge is undefined', () => { test('should render nothing when badge is zero', () => { const wrapper = mount(Badge, { - propsData: { + props: { badge: 0, }, }); diff --git a/src/button/test/index.spec.js b/src/button/test/index.spec.js index e8061023e..9515281c6 100644 --- a/src/button/test/index.spec.js +++ b/src/button/test/index.spec.js @@ -10,7 +10,7 @@ test('should emit click event', () => { test('should not emit click event when disabled', () => { const wrapper = mount(Button, { - propsData: { + props: { disabled: true, }, }); @@ -21,7 +21,7 @@ test('should not emit click event when disabled', () => { test('should not emit click event when loading', () => { const wrapper = mount(Button, { - propsData: { + props: { loading: true, }, }); @@ -32,7 +32,7 @@ test('should not emit click event when loading', () => { test('should hide border when color is gradient', () => { const wrapper = mount(Button, { - propsData: { + props: { color: 'linear-gradient(#000, #fff)', }, }); @@ -42,7 +42,7 @@ test('should hide border when color is gradient', () => { test('should change icon class prefix when using icon-prefix prop', () => { const wrapper = mount(Button, { - propsData: { + props: { icon: 'success', iconPrefix: 'my-icon', }, @@ -53,7 +53,7 @@ test('should change icon class prefix when using icon-prefix prop', () => { test('should render loading slot and match snapshot', () => { const wrapper = mount(Button, { - propsData: { + props: { loading: true, }, slots: { @@ -66,7 +66,7 @@ test('should render loading slot and match snapshot', () => { test('should render loading of a specific size when using loading-size prop', () => { const wrapper = mount(Button, { - propsData: { + props: { loading: true, loadingSize: '10px', }, @@ -79,7 +79,7 @@ test('should render loading of a specific size when using loading-size prop', () test('should render icon in the right side when setting icon-position to right', () => { const wrapper = mount(Button, { - propsData: { + props: { icon: 'plus', iconPosition: 'right', }, diff --git a/src/calendar/test/index.legacy.js b/src/calendar/test/index.legacy.js index f885ba092..3c4b0727b 100644 --- a/src/calendar/test/index.legacy.js +++ b/src/calendar/test/index.legacy.js @@ -12,7 +12,7 @@ import { test('select event when type is single', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, poppable: false, @@ -28,7 +28,7 @@ test('select event when type is single', async () => { test('select event when type is range', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { type: 'range', minDate, maxDate, @@ -54,7 +54,7 @@ test('select event when type is range', async () => { test('select event when type is multiple', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { type: 'multiple', minDate, maxDate, @@ -89,7 +89,7 @@ test('select event when type is multiple', async () => { test('select event when type is multiple', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { type: 'multiple', minDate, maxDate, @@ -110,7 +110,7 @@ test('select event when type is multiple', async () => { test('should not trigger select event when click disabled day', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, poppable: false, @@ -126,7 +126,7 @@ test('should not trigger select event when click disabled day', async () => { test('confirm event when type is single', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, poppable: false, @@ -145,7 +145,7 @@ test('confirm event when type is single', async () => { test('confirm event when type is range', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { type: 'range', minDate, maxDate, @@ -169,7 +169,7 @@ test('confirm event when type is range', async () => { test('default single date', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { poppable: false, }, }); @@ -182,7 +182,7 @@ test('default single date', async () => { test('default range date', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { type: 'range', poppable: false, }, @@ -198,7 +198,7 @@ test('default range date', async () => { test('reset method', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, type: 'range', @@ -223,7 +223,7 @@ test('reset method', async () => { test('set show-confirm to false', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, type: 'range', @@ -245,7 +245,7 @@ test('set show-confirm to false', async () => { test('row-height prop', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, poppable: false, @@ -261,7 +261,7 @@ test('row-height prop', async () => { test('formatter prop', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, poppable: false, @@ -296,7 +296,7 @@ test('formatter prop', async () => { test('title & footer slot', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, poppable: false, @@ -315,7 +315,7 @@ test('title & footer slot', async () => { test('should reset when type changed', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, poppable: false, @@ -340,7 +340,7 @@ test('should reset when type changed', async () => { test('default-date prop in single type', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, defaultDate: getNextDay(minDate), @@ -360,7 +360,7 @@ test('default-date prop in single type', async () => { test('default-date prop in range type', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { type: 'range', minDate, maxDate, @@ -385,7 +385,7 @@ test('default-date prop in range type', async () => { test('popup wrapper', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, defaultDate: minDate, @@ -411,7 +411,7 @@ test('popup wrapper', async () => { test('set show-mark prop to false', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, showMark: false, @@ -426,7 +426,7 @@ test('set show-mark prop to false', async () => { test('color prop when type is single', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, color: 'blue', @@ -442,7 +442,7 @@ test('color prop when type is single', async () => { test('color prop when type is range', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { defaultDate: [minDate, maxDate], type: 'range', minDate, @@ -459,7 +459,7 @@ test('color prop when type is range', async () => { test('close event', () => { const wrapper = mount(Calendar, { - propsData: { + props: { value: true, }, }); diff --git a/src/calendar/test/prop.legacy.js b/src/calendar/test/prop.legacy.js index 6d3f177d0..b1b420da3 100644 --- a/src/calendar/test/prop.legacy.js +++ b/src/calendar/test/prop.legacy.js @@ -4,7 +4,7 @@ import { minDate, maxDate, formatRange, formatDate } from './utils'; test('max-range prop when type is range and showConfirm is false', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { type: 'range', minDate, maxDate, @@ -29,7 +29,7 @@ test('max-range prop when type is range and showConfirm is false', async () => { test('max-range prop when type is range and showConfirm is true', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { type: 'range', minDate, maxDate, @@ -53,7 +53,7 @@ test('max-range prop when type is range and showConfirm is true', async () => { test('max-range prop when type is multiple', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { type: 'multiple', minDate, maxDate, @@ -74,7 +74,7 @@ test('max-range prop when type is multiple', async () => { test('show-title prop', () => { const wrapper = mount(Calendar, { - propsData: { + props: { value: true, }, }); @@ -86,7 +86,7 @@ test('show-title prop', () => { test('show-subtitle prop', () => { const wrapper = mount(Calendar, { - propsData: { + props: { value: true, }, }); @@ -98,7 +98,7 @@ test('show-subtitle prop', () => { test('hide close icon when there is no title', () => { const wrapper = mount(Calendar, { - propsData: { + props: { value: true, }, }); @@ -115,7 +115,7 @@ test('hide close icon when there is no title', () => { test('allow-same-day prop', async () => { const select = jest.fn(); const wrapper = mount(Calendar, { - propsData: { + props: { type: 'range', minDate, maxDate, @@ -144,7 +144,7 @@ test('allow-same-day prop', async () => { test('min-date after current time', () => { const wrapper = mount(Calendar, { - propsData: { + props: { poppable: false, minDate: new Date(2200, 0, 1), maxDate: new Date(2200, 0, 2), @@ -157,7 +157,7 @@ test('min-date after current time', () => { test('min-date before current time', () => { const wrapper = mount(Calendar, { - propsData: { + props: { poppable: false, minDate: new Date(1800, 0, 1), maxDate: new Date(1800, 0, 2), @@ -170,7 +170,7 @@ test('min-date before current time', () => { test('lazy-render prop', () => { const wrapper = mount(Calendar, { - propsData: { + props: { minDate, maxDate, poppable: false, @@ -183,7 +183,7 @@ test('lazy-render prop', () => { test('month-show event', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { value: true, }, }); @@ -194,7 +194,7 @@ test('month-show event', async () => { test('first day of week', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { poppable: false, defaultDate: new Date(2020, 7, 1), minDate: new Date(2020, 7, 1), @@ -216,7 +216,7 @@ test('first day of week', async () => { test('readonly prop', async () => { const wrapper = mount(Calendar, { - propsData: { + props: { type: 'multiple', minDate, maxDate, diff --git a/src/card/test/index.legacy.js b/src/card/test/index.legacy.js index 7fd5410e0..c8c04f0ce 100644 --- a/src/card/test/index.legacy.js +++ b/src/card/test/index.legacy.js @@ -23,7 +23,7 @@ test('click event', () => { test('click-thumb event', () => { const onClickThumb = jest.fn(); const wrapper = mount(Card, { - propsData: { + props: { thumb: 'xx', }, context: { diff --git a/src/cell/test/index.legacy.js b/src/cell/test/index.legacy.js index 2f639b3ce..20ff9875b 100644 --- a/src/cell/test/index.legacy.js +++ b/src/cell/test/index.legacy.js @@ -18,7 +18,7 @@ test('click event', () => { test('arrow direction', () => { const wrapper = mount(Cell, { - propsData: { + props: { isLink: true, arrowDirection: 'down', }, @@ -47,7 +47,7 @@ test('render slot', () => { test('title-style prop', () => { const wrapper = mount(Cell, { - propsData: { + props: { title: 'title', titleStyle: { color: 'red', @@ -70,7 +70,7 @@ test('CellGroup title slot', () => { test('icon-prefix prop', () => { const wrapper = mount(Cell, { - propsData: { + props: { iconPrefix: 'my-icon', icon: 'success', }, diff --git a/src/checkbox/test/index.legacy.js b/src/checkbox/test/index.legacy.js index 77af1629f..33e475eeb 100644 --- a/src/checkbox/test/index.legacy.js +++ b/src/checkbox/test/index.legacy.js @@ -19,7 +19,7 @@ test('switch checkbox', async () => { test('disabled', () => { const wrapper = mount(Checkbox, { - propsData: { + props: { disabled: true, }, }); @@ -33,7 +33,7 @@ test('label disabled', () => { scopedSlots: { default: () => 'Label', }, - propsData: { + props: { labelDisabled: true, }, }); @@ -96,7 +96,7 @@ test('label-position prop', () => { scopedSlots: { default: () => 'Label', }, - propsData: { + props: { labelPosition: 'left', }, }); diff --git a/src/circle/test/index.legacy.js b/src/circle/test/index.legacy.js index a598bf044..e4f904b54 100644 --- a/src/circle/test/index.legacy.js +++ b/src/circle/test/index.legacy.js @@ -4,7 +4,7 @@ import { mount, later } from '../../../test'; test('speed is 0', async () => { const wrapper = mount(Circle, { - propsData: { + props: { rate: 50, value: 0, }, @@ -24,7 +24,7 @@ test('speed is 0', async () => { test('animate', async () => { const onInput = jest.fn(); mount(Circle, { - propsData: { + props: { rate: 50, speed: 100, }, @@ -40,7 +40,7 @@ test('animate', async () => { test('size prop', () => { const wrapper = mount(Circle, { - propsData: { + props: { size: 100, }, }); @@ -50,7 +50,7 @@ test('size prop', () => { test('stroke-linecap prop', () => { const wrapper = mount(Circle, { - propsData: { + props: { strokeLinecap: 'square', }, }); diff --git a/src/collapse/test/index.legacy.js b/src/collapse/test/index.legacy.js index f18226ad6..3903cd42b 100644 --- a/src/collapse/test/index.legacy.js +++ b/src/collapse/test/index.legacy.js @@ -44,7 +44,7 @@ test('basic mode', async () => { test('accordion', async () => { const wrapper = mount(component, { - propsData: { + props: { accordion: true, }, }); @@ -88,7 +88,7 @@ test('render collapse-item slot', () => { test('disable border', () => { const wrapper = mount(component, { - propsData: { + props: { border: false, }, }); diff --git a/src/contact-card/test/index.legacy.js b/src/contact-card/test/index.legacy.js index 76ad44a38..bc77c5561 100644 --- a/src/contact-card/test/index.legacy.js +++ b/src/contact-card/test/index.legacy.js @@ -18,7 +18,7 @@ test('should emit click event after clicking the ContactCard', () => { test('should not emit click event after clicking the uneditable ContactCard', () => { const click = jest.fn(); const wrapper = mount(ContactCard, { - propsData: { + props: { editable: false, }, context: { diff --git a/src/contact-edit/test/index.legacy.js b/src/contact-edit/test/index.legacy.js index 150ba2723..77677911f 100644 --- a/src/contact-edit/test/index.legacy.js +++ b/src/contact-edit/test/index.legacy.js @@ -8,7 +8,7 @@ const contactInfo = { const createComponent = () => { const wrapper = mount(ContactEdit, { - propsData: { + props: { contactInfo, }, }); @@ -61,7 +61,7 @@ test('should watch contact info', () => { test('should allow deleting contact', async () => { const wrapper = mount(ContactEdit, { - propsData: { + props: { isEdit: true, }, }); diff --git a/src/contact-list/test/index.legacy.js b/src/contact-list/test/index.legacy.js index 63b1c3268..5c6e7681e 100644 --- a/src/contact-list/test/index.legacy.js +++ b/src/contact-list/test/index.legacy.js @@ -8,7 +8,7 @@ const contactInfo = { test('should render ContactList correctly', () => { const wrapper = mount(ContactList, { - propsData: { + props: { list: [contactInfo], }, }); @@ -18,7 +18,7 @@ test('should render ContactList correctly', () => { test('should emit select event after clicking the radio', () => { const onSelect = jest.fn(); const wrapper = mount(ContactList, { - propsData: { + props: { list: [contactInfo], }, context: { diff --git a/src/count-down/test/index.legacy.js b/src/count-down/test/index.legacy.js index d1cf1f7d7..3a3973b5f 100644 --- a/src/count-down/test/index.legacy.js +++ b/src/count-down/test/index.legacy.js @@ -3,7 +3,7 @@ import { mount, later } from '../../../test'; test('macro task finish event', async () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 1, }, }); @@ -15,7 +15,7 @@ test('macro task finish event', async () => { test('micro task finish event', async () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 1, millisecond: true, }, @@ -28,7 +28,7 @@ test('micro task finish event', async () => { test('macro task re-render', async () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 1000, format: 'SSS', }, @@ -43,7 +43,7 @@ test('macro task re-render', async () => { test('micro task re-render', async () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 100, format: 'SSS', millisecond: true, @@ -59,7 +59,7 @@ test('micro task re-render', async () => { test('disable auto-start prop', async () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 100, format: 'SSS', autoStart: false, @@ -72,7 +72,7 @@ test('disable auto-start prop', async () => { test('start method', async () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 100, format: 'SSS', autoStart: false, @@ -94,7 +94,7 @@ test('start method', async () => { test('pause method', async () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 100, format: 'SSS', millisecond: true, @@ -111,7 +111,7 @@ test('pause method', async () => { test('reset method', async () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 100, format: 'SSS', millisecond: true, @@ -128,7 +128,7 @@ test('reset method', async () => { test('complete format prop', () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 30 * 60 * 60 * 1000 - 1, autoStart: false, format: 'DD-HH-mm-ss-SSS', @@ -140,7 +140,7 @@ test('complete format prop', () => { test('milliseconds format SS', () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 1500, autoStart: false, format: 'ss-SS', @@ -152,7 +152,7 @@ test('milliseconds format SS', () => { test('milliseconds format S', () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 1500, autoStart: false, format: 'ss-S', @@ -164,7 +164,7 @@ test('milliseconds format S', () => { test('incomplate format prop', () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 30 * 60 * 60 * 1000 - 1, autoStart: false, format: 'HH-mm-ss-SSS', @@ -216,7 +216,7 @@ test('pause when deactivated', async () => { test('change event', async () => { const wrapper = mount(CountDown, { - propsData: { + props: { time: 1, }, }); diff --git a/src/coupon-list/test/index.legacy.js b/src/coupon-list/test/index.legacy.js index 5233a6f3d..7a9a70928 100644 --- a/src/coupon-list/test/index.legacy.js +++ b/src/coupon-list/test/index.legacy.js @@ -76,7 +76,7 @@ const disabledDiscountCoupon = { test('render disabled coupon', () => { const wrapper = mount(Coupon, { - propsData: { + props: { coupon: disabledCoupon, disabled: true, }, @@ -87,7 +87,7 @@ test('render disabled coupon', () => { test('render coupon list', async () => { const wrapper = mount(CouponList, { - propsData: { + props: { chosenCoupon: 1, coupons: [ emptyCoupon, @@ -106,7 +106,7 @@ test('render coupon list', async () => { test('render empty coupon list', () => { const wrapper = mount(CouponList, { - propsData: { + props: { coupons: [], disabledCoupons: [], }, @@ -117,7 +117,7 @@ test('render empty coupon list', () => { test('empty-image prop', () => { const wrapper = mount(CouponList, { - propsData: { + props: { emptyImage: 'https://img.yzcdn.com/xxx.png', }, }); @@ -161,7 +161,7 @@ test('render coupon cell', () => { test('render coupon cell with coupon', () => { const wrapper = mount(CouponCell, { - propsData: { + props: { coupons: [{ value: 100 }], chosenCoupon: 0, }, @@ -171,7 +171,7 @@ test('render coupon cell with coupon', () => { test('render coupon cell with zero discount', () => { const wrapper = mount(CouponCell, { - propsData: { + props: { coupons: [{ ...coupon4, value: 0, denominations: 150 }], chosenCoupon: 0, }, diff --git a/src/datetime-picker/test/date-picker.legacy.js b/src/datetime-picker/test/date-picker.legacy.js index c2bb31d01..ae0508025 100644 --- a/src/datetime-picker/test/date-picker.legacy.js +++ b/src/datetime-picker/test/date-picker.legacy.js @@ -12,7 +12,7 @@ function formatter(type, value) { test('filter prop', () => { const wrapper = mount(DatePicker, { - propsData: { + props: { filter, minDate: new Date(2020, 0, 1), maxDate: new Date(2025, 10, 1), @@ -25,7 +25,7 @@ test('filter prop', () => { test('formatter prop', async () => { const wrapper = mount(DatePicker, { - propsData: { + props: { filter, formatter, minDate: new Date(2010, 0, 1), @@ -53,7 +53,7 @@ test('confirm event', () => { const date = new Date(2020, 10, 1, 0, 0); const wrapper = mount(DatePicker, { - propsData: { + props: { value: date, minDate: new Date(2020, 0, 1), maxDate: new Date(2025, 10, 1), @@ -72,7 +72,7 @@ test('year-month type', () => { const date = new Date(2020, 10, 1, 0, 0); const wrapper = mount(DatePicker, { - propsData: { + props: { type: 'year-month', value: date, minDate: new Date(2020, 0, 1), @@ -99,7 +99,7 @@ test('month-day type', () => { const date = new Date(2020, 10, 1, 0, 0); const wrapper = mount(DatePicker, { - propsData: { + props: { type: 'month-day', value: date, minDate: new Date(2020, 0, 1), @@ -124,7 +124,7 @@ test('month-day type', () => { test('datehour type', async () => { const wrapper = mount(DatePicker, { - propsData: { + props: { minDate: new Date(2010, 0, 1), maxDate: new Date(2025, 10, 1), value: new Date(2020, 10, 1, 0, 0), @@ -149,7 +149,7 @@ test('cancel event', () => { test('max-date prop', () => { const maxDate = new Date(2010, 5, 0, 0, 0); const wrapper = mount(DatePicker, { - propsData: { + props: { value: new Date(2020, 10, 30, 30, 30), maxDate, }, @@ -162,7 +162,7 @@ test('max-date prop', () => { test('min-date prop', () => { const minDate = new Date(2030, 0, 0, 0, 0); const wrapper = mount(DatePicker, { - propsData: { + props: { value: new Date(2020, 0, 0, 0, 0), minDate, }, @@ -174,7 +174,7 @@ test('min-date prop', () => { test('dynamic set value', () => { const wrapper = mount(DatePicker, { - propsData: { + props: { value: new Date(2019, 1, 1), }, }); @@ -193,7 +193,7 @@ test('use min-date with filter', async () => { const maxDate = new Date(2040, 0, 0, 0, 0); const wrapper = mount(DatePicker, { - propsData: { + props: { minDate, maxDate, value: new Date(2020, 0, 0, 0, 0), diff --git a/src/datetime-picker/test/datetime-picker.legacy.js b/src/datetime-picker/test/datetime-picker.legacy.js index d23770d31..82f1ddfbc 100644 --- a/src/datetime-picker/test/datetime-picker.legacy.js +++ b/src/datetime-picker/test/datetime-picker.legacy.js @@ -21,7 +21,7 @@ test('confirm & cancel event', () => { test('time type', () => { const wrapper = mount(DatetimePicker, { - propsData: { + props: { type: 'time', minHour: 22, minMinute: 58, diff --git a/src/datetime-picker/test/time-picker.legacy.js b/src/datetime-picker/test/time-picker.legacy.js index 387eef48e..687e2e1ce 100644 --- a/src/datetime-picker/test/time-picker.legacy.js +++ b/src/datetime-picker/test/time-picker.legacy.js @@ -12,7 +12,7 @@ function formatter(type, value) { test('format initial value', () => { const wrapper = mount(TimePicker, { - propsData: { + props: { minHour: 22, minMinute: 58, }, @@ -23,7 +23,7 @@ test('format initial value', () => { test('max-hour & max-minute', () => { const wrapper = mount(TimePicker, { - propsData: { + props: { value: '23:59', maxHour: 2, maxMinute: 2, @@ -35,7 +35,7 @@ test('max-hour & max-minute', () => { test('filter prop', () => { const wrapper = mount(TimePicker, { - propsData: { + props: { filter, value: '12:00', }, @@ -46,7 +46,7 @@ test('filter prop', () => { test('formatter prop', async () => { const wrapper = mount(TimePicker, { - propsData: { + props: { filter, formatter, value: '12:00', @@ -67,7 +67,7 @@ test('formatter prop', async () => { test('confirm event', () => { const wrapper = mount(TimePicker, { - propsData: { + props: { value: '12:00', }, }); @@ -98,7 +98,7 @@ test('dynamic set value', () => { test('change min-minute and emit correct value', async () => { const wrapper = mount(TimePicker, { - propsData: { + props: { value: '12:00', minMinute: 0, }, @@ -113,7 +113,7 @@ test('change min-minute and emit correct value', async () => { test('set max-hour & max-minute smaller than current then emit correct value', async () => { const wrapper = mount(TimePicker, { - propsData: { + props: { value: '23:59', }, }); diff --git a/src/dialog/test/index.legacy.js b/src/dialog/test/index.legacy.js index 8b128bb3e..eae15fa13 100644 --- a/src/dialog/test/index.legacy.js +++ b/src/dialog/test/index.legacy.js @@ -34,7 +34,7 @@ test('Dialog function call', async () => { test('before close', () => { const wrapper = mount(DialogComponent, { - propsData: { + props: { value: true, showCancelButton: true, closeOnClickOverlay: true, @@ -77,7 +77,7 @@ test('register component', () => { test('button color', () => { const wrapper = mount(DialogComponent, { - propsData: { + props: { value: true, showCancelButton: true, cancelButtonColor: 'white', @@ -89,7 +89,7 @@ test('button color', () => { test('button text', () => { const wrapper = mount(DialogComponent, { - propsData: { + props: { value: true, showCancelButton: true, cancelButtonText: 'Custom cancel', @@ -105,7 +105,7 @@ test('dialog component', () => { test('default slot', () => { const wrapper = mount(DialogComponent, { - propsData: { + props: { value: true, }, scopedSlots: { @@ -117,7 +117,7 @@ test('default slot', () => { test('title slot', () => { const wrapper = mount(DialogComponent, { - propsData: { + props: { value: true, }, scopedSlots: { @@ -129,7 +129,7 @@ test('title slot', () => { test('allow-html prop', () => { const wrapper = mount(DialogComponent, { - propsData: { + props: { value: true, message: 'text', allowHtml: false, @@ -148,7 +148,7 @@ test('open & close event', () => { test('width prop', () => { const wrapper = mount(DialogComponent, { - propsData: { + props: { value: true, width: 200, }, diff --git a/src/empty/test/index.legacy.js b/src/empty/test/index.legacy.js index ea4756181..2d22e1e65 100644 --- a/src/empty/test/index.legacy.js +++ b/src/empty/test/index.legacy.js @@ -33,7 +33,7 @@ test('bottom slot', () => { test('render svg when image is network', () => { const wrapper = mount(Empty, { - propsData: { + props: { image: 'network', }, }); @@ -43,7 +43,7 @@ test('render svg when image is network', () => { test('image-size prop', () => { const wrapper = mount(Empty, { - propsData: { + props: { imageSize: 50, }, }); diff --git a/src/field/test/index.legacy.js b/src/field/test/index.legacy.js index a4f9c6b87..497b65cfc 100644 --- a/src/field/test/index.legacy.js +++ b/src/field/test/index.legacy.js @@ -37,7 +37,7 @@ test('click-input event when using input slot', () => { test('click-icon event', () => { const wrapper = mount(Field, { - propsData: { + props: { value: 'a', leftIcon: 'contact', rightIcon: 'search', @@ -53,7 +53,7 @@ test('click-icon event', () => { test('number type', () => { const wrapper = mount(Field, { - propsData: { + props: { value: '', type: 'number', }, @@ -76,7 +76,7 @@ test('number type', () => { test('digit type', () => { const wrapper = mount(Field, { - propsData: { + props: { value: '', type: 'digit', }, @@ -99,7 +99,7 @@ test('digit type', () => { test('render textarea', async () => { const wrapper = mount(Field, { - propsData: { + props: { type: 'textarea', autosize: true, }, @@ -111,7 +111,7 @@ test('render textarea', async () => { test('autosize textarea field', () => { const wrapper = mount(Field, { - propsData: { + props: { type: 'textarea', autosize: {}, }, @@ -126,7 +126,7 @@ test('autosize textarea field', () => { test('autosize object', async () => { const wrapper = mount(Field, { - propsData: { + props: { type: 'textarea', autosize: { maxHeight: 100, @@ -167,7 +167,7 @@ test('maxlength', async () => { attrs: { maxlength: 3, }, - propsData: { + props: { value: 1234, type: 'number', }, @@ -194,7 +194,7 @@ test('maxlength', async () => { test('clearable prop', () => { const wrapper = mount(Field, { - propsData: { + props: { value: 'test', clearable: true, }, @@ -212,7 +212,7 @@ test('clearable prop', () => { test('clear-trigger prop', () => { const wrapper = mount(Field, { - propsData: { + props: { value: 'test', clearable: true, clearTrigger: 'always', @@ -254,7 +254,7 @@ test('render extra slot', () => { test('size prop', () => { const wrapper = mount(Field, { - propsData: { + props: { size: 'large', }, }); @@ -263,7 +263,7 @@ test('size prop', () => { test('label-width prop with unit', () => { const wrapper = mount(Field, { - propsData: { + props: { label: 'Label', labelWidth: '10rem', }, @@ -273,7 +273,7 @@ test('label-width prop with unit', () => { test('label-width prop without unit', () => { const wrapper = mount(Field, { - propsData: { + props: { label: 'Label', labelWidth: 100, }, @@ -283,7 +283,7 @@ test('label-width prop without unit', () => { test('label-class prop', () => { const wrapper = mount(Field, { - propsData: { + props: { label: 'Label', labelClass: 'custom-label-class', }, @@ -293,7 +293,7 @@ test('label-class prop', () => { test('arrow-direction prop', () => { const wrapper = mount(Field, { - propsData: { + props: { isLink: true, arrowDirection: 'up', }, @@ -303,7 +303,7 @@ test('arrow-direction prop', () => { test('formatter prop', () => { const wrapper = mount(Field, { - propsData: { + props: { value: 'abc123', formatter: (value) => value.replace(/\d/g, ''), }, @@ -319,7 +319,7 @@ test('formatter prop', () => { test('format-trigger prop', () => { const wrapper = mount(Field, { - propsData: { + props: { value: 'abc123', formatTrigger: 'onBlur', formatter: (value) => value.replace(/\d/g, ''), @@ -342,7 +342,7 @@ test('format-trigger prop', () => { test('reach max word-limit', () => { const wrapper = mount(Field, { - propsData: { + props: { value: 'foo', maxlength: 3, showWordLimit: true, @@ -353,7 +353,7 @@ test('reach max word-limit', () => { test('reach max word-limit undefined', () => { const wrapper = mount(Field, { - propsData: { + props: { value: undefined, maxlength: 3, showWordLimit: true, @@ -364,7 +364,7 @@ test('reach max word-limit undefined', () => { test('reach max word-limit null', () => { const wrapper = mount(Field, { - propsData: { + props: { value: null, maxlength: 3, showWordLimit: true, @@ -375,7 +375,7 @@ test('reach max word-limit null', () => { test('name prop', () => { const wrapper = mount(Field, { - propsData: { + props: { name: 'foo', }, }); @@ -398,7 +398,7 @@ test('destroy field', () => { test('colon prop', () => { const wrapper = mount(Field, { - propsData: { + props: { label: 'foo', colon: true, }, @@ -426,7 +426,7 @@ test('should blur search input on enter', () => { test('value is null', () => { const wrapper = mount(Field, { - propsData: { + props: { value: null, }, }); diff --git a/src/icon/test/index.legacy.js b/src/icon/test/index.legacy.js index 3e7bb582d..bdffd2d0c 100644 --- a/src/icon/test/index.legacy.js +++ b/src/icon/test/index.legacy.js @@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'; test('render icon with builtin icon name', () => { const wrapper = mount(Icon, { - propsData: { + props: { name: 'success', }, }); @@ -12,7 +12,7 @@ test('render icon with builtin icon name', () => { test('render icon with url name', () => { const wrapper = mount(Icon, { - propsData: { + props: { name: 'https://img.yzcdn.com/icon.jpg', }, }); @@ -21,7 +21,7 @@ test('render icon with url name', () => { test('render icon with local image', () => { const wrapper = mount(Icon, { - propsData: { + props: { name: '/assets/icon.jpg', }, }); @@ -39,7 +39,7 @@ test('render icon default slot', () => { test('tag prop', () => { const wrapper = mount(Icon, { - propsData: { + props: { tag: 'div', }, }); @@ -48,7 +48,7 @@ test('tag prop', () => { test('dot prop', () => { const wrapper = mount(Icon, { - propsData: { + props: { dot: true, }, }); @@ -57,7 +57,7 @@ test('dot prop', () => { test('size without unit', () => { const wrapper = mount(Icon, { - propsData: { + props: { size: 20, }, }); diff --git a/src/image-preview/test/index.legacy.js b/src/image-preview/test/index.legacy.js index 12103af34..6d846255d 100644 --- a/src/image-preview/test/index.legacy.js +++ b/src/image-preview/test/index.legacy.js @@ -39,7 +39,7 @@ const images = [ test('render image', async () => { const wrapper = mount(ImagePreviewVue, { - propsData: { images, value: true }, + props: { images, value: true }, }); expect(wrapper.html()).toMatchSnapshot(); @@ -58,7 +58,7 @@ test('render image', async () => { test('closeable prop', () => { const wrapper = mount(ImagePreviewVue, { - propsData: { + props: { images, value: true, closeable: true, @@ -71,7 +71,7 @@ test('closeable prop', () => { test('close-icon prop', () => { const wrapper = mount(ImagePreviewVue, { - propsData: { + props: { value: true, closeable: true, closeIcon: 'close', @@ -83,7 +83,7 @@ test('close-icon prop', () => { test('close-icon-position prop', () => { const wrapper = mount(ImagePreviewVue, { - propsData: { + props: { value: true, closeable: true, closeIcon: 'close', @@ -96,7 +96,7 @@ test('close-icon-position prop', () => { test('async close prop', async () => { const wrapper = mount(ImagePreviewVue, { - propsData: { + props: { images, value: true, asyncClose: true, @@ -137,7 +137,7 @@ test('function call', (done) => { test('double click', async () => { const onScale = jest.fn(); const wrapper = mount(ImagePreviewVue, { - propsData: { + props: { images, value: true, }, @@ -222,7 +222,7 @@ test('zoom in and drag image to move', async () => { const restore = mockGetBoundingClientRect({ width: 100, height: 100 }); const wrapper = mount(ImagePreviewVue, { - propsData: { images, value: true }, + props: { images, value: true }, }); await later(); @@ -251,7 +251,7 @@ test('zoom out', async () => { const onScale = jest.fn(); const wrapper = mount(ImagePreviewVue, { - propsData: { images, value: true }, + props: { images, value: true }, listeners: { scale: onScale, }, @@ -268,7 +268,7 @@ test('zoom out', async () => { test('set show-index prop to false', () => { const wrapper = mount(ImagePreviewVue, { - propsData: { + props: { value: true, showIndex: false, }, @@ -303,7 +303,7 @@ test('cover slot', () => { test('closeOnPopstate', () => { const wrapper = mount(ImagePreviewVue, { - propsData: { + props: { images, value: true, closeOnPopstate: true, diff --git a/src/image/test/index.legacy.js b/src/image/test/index.legacy.js index f09888e94..66d349b66 100644 --- a/src/image/test/index.legacy.js +++ b/src/image/test/index.legacy.js @@ -11,7 +11,7 @@ test('click event', () => { test('load event', () => { const wrapper = mount(VanImage, { - propsData: { + props: { src: 'https://img.yzcdn.cn/vant/cat.jpeg', }, }); @@ -27,7 +27,7 @@ test('load event', () => { test('error event', () => { const wrapper = mount(VanImage, { - propsData: { + props: { src: 'https://img.yzcdn.cn/vant/cat.jpeg', }, }); @@ -39,7 +39,7 @@ test('error event', () => { test('lazy load', () => { const wrapper = mount(VanImage, { - propsData: { + props: { src: 'https://img.yzcdn.cn/vant/cat.jpeg', lazyLoad: true, }, @@ -50,7 +50,7 @@ test('lazy load', () => { test('lazy-load load event', (done) => { const wrapper = mount(VanImage, { - propsData: { + props: { lazyLoad: true, src: 'https://img.yzcdn.cn/vant/cat.jpeg', }, @@ -77,7 +77,7 @@ test('lazy-load load event', (done) => { test('lazy-load error event', (done) => { const wrapper = mount(VanImage, { - propsData: { + props: { lazyLoad: true, }, mocks: { @@ -103,7 +103,7 @@ test('lazy-load error event', (done) => { test('show-loading prop', () => { const wrapper = mount(VanImage, { - propsData: { + props: { showLoading: false, }, }); @@ -113,7 +113,7 @@ test('show-loading prop', () => { test('show-error prop', () => { const wrapper = mount(VanImage, { - propsData: { + props: { showError: false, src: 'https://img.yzcdn.cn/vant/cat.jpeg', }, @@ -126,7 +126,7 @@ test('show-error prop', () => { test('error-icon prop', () => { const wrapper = mount(VanImage, { - propsData: { + props: { errorIcon: 'error', src: 'https://img.yzcdn.cn/vant/cat.jpeg', }, @@ -139,7 +139,7 @@ test('error-icon prop', () => { test('loading-icon prop', () => { const wrapper = mount(VanImage, { - propsData: { + props: { loadingIcon: 'success', }, }); @@ -149,7 +149,7 @@ test('loading-icon prop', () => { test('apply icon-prefix prop to error-icon', () => { const wrapper = mount(VanImage, { - propsData: { + props: { errorIcon: 'error', iconPrefix: 'my-icon', src: 'https://img.yzcdn.cn/vant/cat.jpeg', @@ -163,7 +163,7 @@ test('apply icon-prefix prop to error-icon', () => { test('apply icon-prefix prop to loading-icon', () => { const wrapper = mount(VanImage, { - propsData: { + props: { loadingIcon: 'success', iconPrefix: 'my-icon', }, @@ -174,7 +174,7 @@ test('apply icon-prefix prop to loading-icon', () => { test('radius prop', () => { const wrapper = mount(VanImage, { - propsData: { + props: { radius: 3, src: 'https://img.yzcdn.cn/vant/cat.jpeg', }, @@ -185,7 +185,7 @@ test('radius prop', () => { test('default slot', () => { const wrapper = mount(VanImage, { - propsData: { + props: { src: 'https://img.yzcdn.cn/vant/cat.jpeg', }, scopedSlots: { diff --git a/src/list/test/index.legacy.js b/src/list/test/index.legacy.js index df55978dc..0a2982fd7 100644 --- a/src/list/test/index.legacy.js +++ b/src/list/test/index.legacy.js @@ -21,7 +21,7 @@ test('load event', async () => { test('error loaded, click error-text and reload', async () => { const wrapper = mount(List, { - propsData: { + props: { errorText: 'Request failed. Click to reload...', error: true, }, @@ -52,7 +52,7 @@ test('error loaded, click error-text and reload', async () => { test('finished', async () => { const wrapper = mount(List, { - propsData: { + props: { finished: true, finishedText: 'Finished', }, @@ -72,7 +72,7 @@ test('finished', async () => { test('finished slot', async () => { const wrapper = mount(List, { - propsData: { + props: { finished: true, }, scopedSlots: { @@ -85,7 +85,7 @@ test('finished slot', async () => { test('error slot', async () => { const wrapper = mount(List, { - propsData: { + props: { error: true, }, scopedSlots: { @@ -98,7 +98,7 @@ test('error slot', async () => { test('immediate check false', async () => { const wrapper = mount(List, { - propsData: { + props: { immediateCheck: false, }, }); @@ -139,7 +139,7 @@ test('check the direction props', () => { slots: { default: '