-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 usePointerEvent props #4553
feat : add usePointerEvent props #4553
Conversation
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.
✅ This pull request was sent to the PullRequest network.
@yuki0410-dev you can click here to see the review status or cancel the code review job.
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.
PullRequest Breakdown
Reviewable lines of change
+ 178
- 55
85% JavaScript (tests)
14% JavaScript
1% Markdown
Type of change
Feature - These changes are adding a new feature or improvement to existing code.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4553 +/- ##
==========================================
+ Coverage 95.52% 95.65% +0.13%
==========================================
Files 29 29
Lines 2569 2579 +10
Branches 1055 1069 +14
==========================================
+ Hits 2454 2467 +13
+ Misses 115 112 -3 ☔ View full report in Codecov by Sentry. |
test/week_test.test.js
Outdated
let dayMouseEntered = null; | ||
|
||
function onDayMouseEnter(day) { | ||
dayMouseEntered = day; | ||
} | ||
|
||
const weekStart = utils.newDate(); | ||
const week = shallow( | ||
const week = mount( |
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.
Shallow was changed to mount because simulate("pointerenter")
could not be fired correctly
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.
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.
I have added a comment.
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.
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.
This is mostly adding a flag for if mouse is available and adding tests accordingly. Looks good!
Reviewed with ❤️ by PullRequest
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.
This is looking really good. Thanks for taking the feedback and submitting this new PR. It's also very appreciated that you took the time to add tests. I just had a few minor comments below.
Reviewed with ❤️ by PullRequest
@@ -160,3 +160,4 @@ | |||
| `wrapperClassName` | `string` | | | | |||
| `yearDropdownItemNumber` | `number` | | | | |||
| `yearItemNumber` | `number` | `DEFAULT_YEAR_ITEM_NUMBER` | | | |||
| `usePointerEvent` | `bool` | `false` | | |
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.
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.
Added description to docs/datepicker.md
, since the description of other Props was also written there.
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.
test/day_test.test.js
Outdated
@@ -932,6 +932,27 @@ describe("Day", () => { | |||
}); | |||
}); | |||
|
|||
describe("pointer enter", () => { | |||
var onMouseEnterCalled; |
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.
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.
I had added a test for Pointer Event in parallel with mouse Event as well as others,
I removed the describe section and added an it section, is this correct?
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.
685f0be
to
a42054a
Compare
Thank you for your review. |
I have closed my previous PR. Is there anything else I can do to get this PR merged? |
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.
I have closed my previous PR.
Is there anything else I can do to get this PR merged?
Thanks for all of your hard work and adjustments to the feedback @yuki0410-dev. We just have to wait for one of the maintainers to approve and merge this.
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.
These changes look good, however the use of Enzyme is deprecated and I'd rather not introduce more test using Enzyme. Can you switch the test cases to React Testing Library?
6ce60d4
to
046c42d
Compare
@martijnrusschen |
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.
I want to fix a bug I reported in a previous PR,
Inspired by the comments in the previous PR, we have modified the policy to allow users to freely choose by Props.