-
Notifications
You must be signed in to change notification settings - Fork 48
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
Nanguan Add test for CreateNewBadgePopup.jsx #2894
Conversation
Frontend Release to Main [3.85]
Frontend Release to Main [3.86]
Frontend Release to Main [3.87]
❌ Deploy Preview for highestgoodnetwork-dev failed.
|
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.
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.
Frontend Release to Main [3.88]
Frontend Release to Main [3.89]
Frontend Release to Main [3.90]
Frontend Release to Main [3.91]
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 tested the functionality described in this PR, and it works as expected.
All test cases in CreateNewBadgePopup.test.js passed successfully without any errors.
Verified that the component renders without crashing and the state updates correctly for all scenarios, including:
Badge name input changes.
Image URL input changes.
Description input changes.
Ranking input changes.
Badge type selection changes.
Great work on adding comprehensive unit tests for this component!
![PR#2894](https://private-user-images.githubusercontent.com/105243824/395831179-06d0c699-1f5b-4f19-a0ea-032867aa37c2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDczODUsIm5iZiI6MTczOTIwNzA4NSwicGF0aCI6Ii8xMDUyNDM4MjQvMzk1ODMxMTc5LTA2ZDBjNjk5LTFmNWItNGYxOS1hMGVhLTAzMjg2N2FhMzdjMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQxNzA0NDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yZDU1NTIxM2ZkYmIwMGUzNzQwYTM0N2U1YmQwOTljNDAxY2E4NjljNjY1M2U2ZjY5M2E1Nzg4NTljZDQxOWZkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.QxLupRvX7n-lHWY05Nj2UZCQtKtSTm7dGrPD5E7Jlk0)
Frontend Release to Main [3.91]
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.
Frontend Release to Main [3.92]
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.
Hi there, you've done great work so far on this test file, but I'm going to request changes for the following reasons.
-
Render Verification:
Add assertions for all key elements (e.g., input fields, dropdowns, buttons) to ensure they render correctly. Verifying just the "create" button alone isn't adequate -
Conditional Logic:
Test visibility of fields that appear or change based on the selected badge type (e.g., showTotalHrs, showWeeks). -
Button State:
Verify the "Create" button is enabled or disabled based on input validity. -
Form Submission:
Mock the createNewBadge function and verify it is called with the correct data on form submission.
Once these tests are modified/added you'll have my approval.
9481328
replace by #3027 |
Description
Add unit test for CreateNewBadgePopup.jsx
Main changes explained:
Added a new file under reducers/tests called CreateNewBadgePopup.test.js
Test the following scenarios:
How to test:
Screenshots or videos of changes: