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

Unit Test : Add User Function Test #864

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

Conversation

barchakuz
Copy link
Contributor

Unit Test 1 : Add User function

Summary

This pull request adds test code using the Jest framework for the addUser function in the Signup.js file. The tests cover various scenarios including email validation, different user types, API calls, and error handling.

Motivation

The motivation behind this pull request is to ensure the correctness and reliability of the addUser function by implementing comprehensive test coverage. This helps in catching bugs early and ensuring that the function behaves as expected under different conditions.

Testing

The test code has been written using Jest and includes mocks for external dependencies like document.getElementById and fetch to simulate user input and API requests. Each test case covers a specific scenario, and the test suite has been run using the Jest CLI to verify the functionality.

@birm birm changed the base branch from master to develop March 29, 2024 21:02
@birm
Copy link
Member

birm commented Mar 29, 2024

Hi! This looks interesting! How did you run/set this for testing?

@barchakuz
Copy link
Contributor Author

@birm I've integrated Jest, a JavaScript testing framework, for unit testing. I've utilized a custom script in test.signup to automate form submission. The values for the form are visible within the test script.

Copy link

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants