mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-20 20:30:35 +03:00
fix: when custom formatting causes the time-panel error (#377)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { mount } from '@vue/test-utils';
|
||||
import TimePanel from '../src/time/time-panel';
|
||||
import ListColumns from '../src/time/list-columns.vue';
|
||||
|
||||
let wrapper;
|
||||
|
||||
@@ -96,4 +97,17 @@ describe('TimePanel', () => {
|
||||
hour.trigger('click');
|
||||
expect(wrapper.emitted().select).toBeUndefined();
|
||||
});
|
||||
|
||||
it('fix: when the custom format pass into time panel', () => {
|
||||
wrapper = mount(TimePanel, {
|
||||
propsData: {
|
||||
value: new Date(),
|
||||
format: {},
|
||||
},
|
||||
});
|
||||
const cols = wrapper.find(ListColumns);
|
||||
expect(cols.props('showHour')).toBe(true);
|
||||
expect(cols.props('showMinute')).toBe(true);
|
||||
expect(cols.props('showSecond')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user