2
0
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:
mengxiong10
2019-11-21 18:24:51 +08:00
parent 742c4083ea
commit bf949afc7d
2 changed files with 19 additions and 3 deletions
+14
View File
@@ -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);
});
});