mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
test(Calendar): fix unknown cause exception
This commit is contained in:
parent
418c764e8f
commit
cd7948f031
@ -464,27 +464,6 @@ test('should scroll to current month when show', async done => {
|
|||||||
await later();
|
await later();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('max-range prop', async () => {
|
|
||||||
const wrapper = mount(Calendar, {
|
|
||||||
propsData: {
|
|
||||||
type: 'range',
|
|
||||||
minDate,
|
|
||||||
maxDate,
|
|
||||||
maxRange: 1,
|
|
||||||
poppable: false,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
await later();
|
|
||||||
|
|
||||||
const days = wrapper.findAll('.van-calendar__day');
|
|
||||||
days.at(15).trigger('click');
|
|
||||||
days.at(18).trigger('click');
|
|
||||||
wrapper.find('.van-calendar__confirm').trigger('click');
|
|
||||||
|
|
||||||
expect(wrapper.emitted('confirm')).toBeFalsy();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('close event', () => {
|
test('close event', () => {
|
||||||
const wrapper = mount(Calendar, {
|
const wrapper = mount(Calendar, {
|
||||||
propsData: {
|
propsData: {
|
||||||
|
26
src/calendar/test/prop.spec.js
Normal file
26
src/calendar/test/prop.spec.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import Calendar from '..';
|
||||||
|
import { mount, later } from '../../../test';
|
||||||
|
|
||||||
|
const minDate = new Date(2010, 0, 10);
|
||||||
|
const maxDate = new Date(2010, 0, 20);
|
||||||
|
|
||||||
|
test('max-range prop', async () => {
|
||||||
|
const wrapper = mount(Calendar, {
|
||||||
|
propsData: {
|
||||||
|
type: 'range',
|
||||||
|
minDate,
|
||||||
|
maxDate,
|
||||||
|
maxRange: 1,
|
||||||
|
poppable: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
await later();
|
||||||
|
|
||||||
|
const days = wrapper.findAll('.van-calendar__day');
|
||||||
|
days.at(15).trigger('click');
|
||||||
|
days.at(18).trigger('click');
|
||||||
|
wrapper.find('.van-calendar__confirm').trigger('click');
|
||||||
|
|
||||||
|
expect(wrapper.emitted('confirm')).toBeFalsy();
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user