Skip to content
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 #3027

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

lng2020
Copy link

@lng2020 lng2020 commented Jan 9, 2025

replace #2894

Test following as requested by #2894 (review)

  1. 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

  2. Conditional Logic:
    Test visibility of fields that appear or change based on the selected badge type (e.g., showTotalHrs, showWeeks).

  3. Button State:
    Verify the "Create" button is enabled or disabled based on input validity.

  4. Form Submission:
    Mock the createNewBadge function and verify it is called with the correct data on form submission.

result
Screenshot_20250109_044911

cc @KurtisIvey

Copy link

netlify bot commented Jan 9, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit c7f2c99
🔍 Latest deploy log https://app.netlify.com/sites/highestgoodnetwork-dev/deploys/677fa9d9ad69460008b251c9
😎 Deploy Preview https://deploy-preview-3027--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@Nahiyan-16 Nahiyan-16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Nanguan,

Great job on the PR! The tests for CreateNewBadgePopup are well-structured and cover key functionality like rendering, conditional fields, form validation, and data submission. I appreciate how you used jest.mock for action handling and fireEvent for simulating user interactions. One suggestion would be to explore edge cases like unexpected inputs or API failures to make the coverage even more robust. Overall, this is a solid contribution—nice work!

Screenshot 2025-01-11 at 10 13 45 PM

Copy link

@ManasaViswanadhapalli ManasaViswanadhapalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is showing all the tests based on Acceptance criteria. Good Work!!
image

Copy link

@srikanthpusthem srikanthpusthem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

test passed as expected for the requested.

Copy link
Contributor

@abdel-lall abdel-lall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Good job!
Screenshot 2025-01-11 233121

@Maddila-Anjali
Copy link

Works perfect
Screenshot 2025-01-17 at 4 14 20 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants