-
Notifications
You must be signed in to change notification settings - Fork 167
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
Unit Test Case for useDraggableTable #2540
Unit Test Case for useDraggableTable #2540
Conversation
I was able to get |
c9ddf08
to
1b31725
Compare
There doesn't seem to be any stability checks being made for the hook return value. |
979a7d5
to
dde3236
Compare
@christianvogt updated the test case accordingly. It's up for review. Thanks! |
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.
You're testing drag functions individually however when used in pratice, they are called sequence. The only way to establish an internal state is to call the functions in the correct order. For example, onDragEnd
will set isDragging
to false. Unless you've started your test with a call to onDragStart
, there's no way you can assert the class name has changed because of a change to isDragging
.
I suggest you add at least one end to end test case that runs through the happy path.
@christianvogt. Thank you for the feedback and suggestion, Based on your comment, I have used a different approach and made the necessary updates. |
/retest |
760e7b7
to
e76836d
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Closes: RHOAIENG-2120
Description
added unit test for frontend/src/utilities/useDraggableTable.ts
How Has This Been Tested?
npm run test
Test Impact
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main