Skip to content

Commit 32b594c

Browse files
committed
Adding a prop test
1 parent 44c6397 commit 32b594c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/calendar/index.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ describe('Calendar', () => {
3939
expect(drv.getDays()).toEqual(expectedDays);
4040
});
4141

42+
it('should render month from `initialDate` prop date', () => {
43+
const expectedDays = getDaysArray(1, 31);
44+
expectedDays.push(...getDaysArray(1, 4)); // April days
45+
const drv = new CalendarDriver().withDefaultProps({initialDate: '2020-03-01'}).render();
46+
expect(drv.getDays()).toEqual(expectedDays);
47+
});
48+
4249
it('should render calendar with week numbers with `showWeekNumbers={true}` prop', () => {
4350
const drv = new CalendarDriver().withDefaultProps({showWeekNumbers: true}).render();
4451
expect(drv.getWeekNumbers()).toEqual(['14', '15', '16', '17', '18']);

0 commit comments

Comments
 (0)