Skip to content

Commit

Permalink
test: 更新日历组件单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed May 6, 2024
1 parent 50541cd commit 938a97a
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions packages/fighting-design/calendar/__test__/calendar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,52 @@ describe('Calendar', () => {
})
expect(wrapper.classes()).toContain('f-calendar')
})

test('border', () => {
const wrapper = mount(FCalendar,
{
props: { date: new Date(), border: true }
})
expect(wrapper.classes()).toContain('f-calendar__border')
})

test('borderColor', () => {
const wrapper = mount(FCalendar,
{
props: { date: new Date(), border: true, borderColor: 'red' }
})
expect(wrapper.attributes('style')).toContain('--calendar-border-color: red')
})

test('dayCellHeight', () => {
const wrapper = mount(FCalendar,
{
props: { date: new Date(), dayCellHeight: '20px' }
})
expect(wrapper.attributes('style')).toContain('--calendar-day-cell-height: 20px')
})

test('dayCellHeight', () => {
const wrapper = mount(FCalendar,
{
props: { date: new Date(), dayCellHeight: 44 }
})
expect(wrapper.attributes('style')).toContain('--calendar-day-cell-height: 44px')
})

test('weekCellHeight', () => {
const wrapper = mount(FCalendar,
{
props: { date: new Date(), weekCellHeight: '20px' }
})
expect(wrapper.attributes('style')).toContain('--calendar-week-cell-height: 20px')
})

test('weekCellHeight', () => {
const wrapper = mount(FCalendar,
{
props: { date: new Date(), weekCellHeight: 44 }
})
expect(wrapper.attributes('style')).toContain('--calendar-week-cell-height: 44px')
})
})

0 comments on commit 938a97a

Please sign in to comment.