-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
disabledDays
prop to Calendar
- Loading branch information
1 parent
05d173e
commit 502b83a
Showing
25 changed files
with
451 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const PageCalendar = require('../../../src/components/Calendar/pageObject'); | ||
|
||
const CALENDAR = '#calendar-11'; | ||
|
||
describe('Calendar', () => { | ||
beforeAll(async () => { | ||
await browser.url('/#!/Calendar/11'); | ||
}); | ||
beforeEach(async () => { | ||
await browser.refresh(); | ||
const component = await $(CALENDAR); | ||
await component.waitForExist(); | ||
}); | ||
it('should set range initial date and end date button elements as selected', async () => { | ||
const calendar = await PageCalendar(CALENDAR); | ||
await calendar.clickLeftMonthDay(2); | ||
await calendar.clickRightMonthDay(16); | ||
await expect(await calendar.isLeftMonthDaySelected(2)).toBe(true); | ||
await expect(await calendar.isRightMonthDaySelected(16)).toBe(true); | ||
}); | ||
it('should set range initial and end dates when using keyboard navigation', async () => { | ||
const calendar = await PageCalendar(CALENDAR); | ||
await calendar.clickLeftMonthSelectYear(); | ||
await browser.keys('Escape'); | ||
await browser.keys('Tab'); | ||
await browser.keys('ArrowUp'); | ||
await browser.keys('ArrowLeft'); | ||
await browser.keys('Enter'); | ||
await browser.keys('PageDown'); | ||
await browser.keys('ArrowDown'); | ||
await browser.keys('Enter'); | ||
await expect(await calendar.isLeftMonthDaySelected(15)).toBe(true); | ||
await expect(await calendar.isRightMonthDaySelected(22)).toBe(true); | ||
}); | ||
it('should disable all days beyond the first disabled day when selecting range', async () => { | ||
const calendar = await PageCalendar(CALENDAR); | ||
await calendar.clickRightMonthDay(14); | ||
await expect(await calendar.isRightMonthDayEnabled(23)).toBe(false); | ||
await expect(await calendar.isRightMonthDayEnabled(24)).toBe(false); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.