2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-22 03:30:35 +03:00

feat: default-value supports Array for range (#395)

This commit is contained in:
xiemx
2019-12-16 18:13:08 +08:00
parent c8f7122b63
commit b33c9b8f19
9 changed files with 46 additions and 14 deletions
+13
View File
@@ -76,4 +76,17 @@ describe('CalendarRange', () => {
expect(startPanel.vm.partialUpdate).toBe(false);
expect(endPanel.vm.partialUpdate).toBe(false);
});
it('supports defaultValue is Array', () => {
wrapper = mount(CalendarRange, {
propsData: {
defaultValue: [new Date(2019, 9, 1), new Date(2019, 11, 1)],
},
});
const panels = wrapper.findAll(CalendarPanel);
const startPanel = panels.at(0);
const endPanel = panels.at(1);
expect(startPanel.vm.calendarMonth).toBe(9);
expect(endPanel.vm.calendarMonth).toBe(11);
});
});