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

(SP: 2) Write test for onResponse & onError in CreateOrEditOffer.tsx #2909

Open
dudchakk opened this issue Nov 29, 2024 · 0 comments
Open

(SP: 2) Write test for onResponse & onError in CreateOrEditOffer.tsx #2909

dudchakk opened this issue Nov 29, 2024 · 0 comments
Assignees
Labels
bug Something isn't working Functional Something isn't working sonarFix fix the sonar issues test

Comments

@dudchakk
Copy link
Contributor

Description: The component CreateOrEditOffer.tsx includes functionality to handle responses and errors from the useAxios hook through the onResponse and onError callbacks. To ensure these callbacks work as expected, unit tests need to be written.

onResponse:

  • Simulate a successful Axios request using the mocked useAxios hook;
  • Verify that the onResponse callback is called with the correct data;
  • Ensure the component dispatches the correct openAlert message and navigates to the right url.

onError:

  • Simulate a failed Axios request using the mocked useAxios hook;
  • Verify that the onError callback is triggered;
  • Ensure the component dispatches the correct openAlert message.

Code coverage right now:

image

image
image

@dudchakk dudchakk added bug Something isn't working test Functional Something isn't working sonarFix fix the sonar issues labels Nov 29, 2024
@github-project-automation github-project-automation bot moved this to Project Backlog in SpaceToStudy Nov 29, 2024
@Made1ra Made1ra self-assigned this Nov 29, 2024
@Made1ra Made1ra moved this from Project Backlog to In progress in SpaceToStudy Nov 29, 2024
@Made1ra Made1ra linked a pull request Nov 29, 2024 that will close this issue
@Made1ra Made1ra moved this from In progress to Project Backlog in SpaceToStudy Dec 3, 2024
@Made1ra Made1ra removed their assignment Dec 3, 2024
@sandrvvu sandrvvu self-assigned this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Functional Something isn't working sonarFix fix the sonar issues test
Projects
Status: Project Backlog
Development

No branches or pull requests

3 participants