test: replace propsData with props
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -21,7 +21,7 @@ test('confirm & cancel event', () => {
|
||||
|
||||
test('time type', () => {
|
||||
const wrapper = mount(DatetimePicker, {
|
||||
propsData: {
|
||||
props: {
|
||||
type: 'time',
|
||||
minHour: 22,
|
||||
minMinute: 58,
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user