New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add disabledDays
prop to Calendar
#2428
Conversation
Features
ContributorsHellWolf93, LeandroTorresSicilia Commit-Lint commandsYou can trigger Commit-Lint actions by commenting on this PR:
|
await expect(await calendar.getLeftMonthSelectedDay()).toBe(undefined); | ||
await expect(await calendar.getRightMonthSelectedDay()).toBe('6'); | ||
}); | ||
it('should focus the correct day in left month when an arrow key is pressed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
await browser.keys('ArrowRight'); | ||
await expect(await calendar.isLeftMonthDayFocused(11)).toBe(true); | ||
}); | ||
it('should focus the correct day in right month when an arrow key is pressed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 3 locations. Consider refactoring.
await browser.keys('ArrowRight'); | ||
await expect(await calendar.isRightMonthDayFocused(11)).toBe(true); | ||
}); | ||
it('should focus the first day of the week in left month when HOME key is pressed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 6 locations. Consider refactoring.
await browser.keys('Home'); | ||
await expect(await calendar.isLeftMonthDayFocused(8)).toBe(true); | ||
}); | ||
it('should focus the first day of the week in right month when HOME key is pressed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 6 locations. Consider refactoring.
await browser.keys('Home'); | ||
await expect(await calendar.isRightMonthDayFocused(5)).toBe(true); | ||
}); | ||
it('should focus the last day of the week in left month when END key is pressed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 6 locations. Consider refactoring.
Visit the preview URL for this PR (updated for commit 99b5600): https://react-rainbow--pr2428-add-disabled-days-53i0tjwl.web.app (expires Mon, 18 Jul 2022 17:31:26 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
await browser.keys('End'); | ||
await expect(await calendar.isLeftMonthDayFocused(14)).toBe(true); | ||
}); | ||
it('should focus the last day of the week in right month when END key is pressed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 6 locations. Consider refactoring.
await expect(await calendar.getRightSelectedMonth()).toBe('February'); | ||
await expect(await calendar.isRightMonthDayFocused(11)).toBe(true); | ||
}); | ||
it('should change to the previous year when ALT + PAGEUP keys are pressed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
await browser.keys('Tab'); | ||
await expect(await calendar.isRightMonthDayFocused(11)).toBe(true); | ||
}); | ||
it('should change to next year when ALT + PAGEDOWN keys are pressed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
await expect(await calendar.getRightSelectedMonth()).toBe('February'); | ||
await expect(await calendar.isRightMonthDayFocused(1)).toBe(true); | ||
}); | ||
it('should change to the previous month when PAGEUP key is pressed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
await expect(await calendar.getRightSelectedMonth()).toBe('December'); | ||
await expect(await calendar.isLeftMonthDayFocused(11)).toBe(true); | ||
}); | ||
it('should change to next month when PAGEDOWN key is pressed', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
Code Climate has analyzed commit 99b5600 and detected 28 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
fix: #2423
Changes proposed in this PR:
Added
disabledDays
prop to Calendar, DatePicker, DateTimePicker and its modalsI have followed (at least) the PR section of the contributing guide.