Skip to content

Commit

Permalink
修复日期选择器的一个 BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
Hex committed Feb 15, 2022
1 parent 9f71003 commit 0b4baa0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<cb-datetime-picker v-model="form.date1" use-time use-range required />
</cb-form-group>
<cb-form-group label="活动时间2:">
<cb-datetime-picker v-model="form.date2" use-time use-range />
<cb-datetime-picker v-model="form.date2" use-time use-range max-span="7" />
</cb-form-group>
<cb-form-group label="活动性质:">
<cb-checkbox-group inline v-model="form.data1" required>
Expand Down
29 changes: 28 additions & 1 deletion test/box/box.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
import { shallowMount } from '@vue/test-utils';
import Component from '../../packages/box/src/box.vue';

const factory = (propsData) => {
return shallowMount(Component, {
propsData: {
...propsData
}
})
}

describe('box', () => {
it('renders dom when mounted', () => {
const wrapper = shallowMount(Component);
const wrapper = factory();
expect(wrapper.classes()).toContain('cb-box');
});

it('renders props.theme when passed', () => {
const theme = 'primary';
const wrapper = factory({ theme });

expect(wrapper.classes()).toContain(`box-${theme}`);
});

it('renders props.collapsed when passed', () => {
const wrapper = factory({ collapsed: true });

expect(wrapper.classes()).toContain('collapsed-box');
});

it('renders props.solid when passed', () => {
const wrapper = factory({ solid: true });

expect(wrapper.classes()).toContain('box-solid');
});
});
1 change: 1 addition & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module.exports = () => ({
dayjs.extend(require('dayjs/plugin/arraySupport'));
dayjs.extend(require('dayjs/plugin/badMutable'));
dayjs.extend(require('dayjs/plugin/updateLocale'));
dayjs.extend(require('dayjs/plugin/objectSupport'));
dayjs.updateLocale('zh-cn', { weekStart: 0 });
`
});
Expand Down

0 comments on commit 0b4baa0

Please sign in to comment.