test: replace propsData with props
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user