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

(test) O3-2081: Fix tests for the PatientRegistration component #709

Merged
merged 23 commits into from
Aug 18, 2023

Conversation

ayush-AI
Copy link
Contributor

@ayush-AI ayush-AI commented May 25, 2023

Requirements

Summary

In this PR, I fixed all the failing test cases for patient-registation.test.tsx file. There were multiple tests failing due to multiple reasons. I addressed those issues and now all the tests are passing except this one. I have added necessary comments why the test is failing and also commented the approaches that I took in attempt to fix the issue, but the test is still failing.

Screenshots

None.

Related Issue

https://issues.openmrs.org/browse/O3-2082

Other

Please look into the failing test and suggest some ways to fix it.

None.

@ayush-AI
Copy link
Contributor Author

@ayush-AI ayush-AI marked this pull request as draft May 25, 2023 20:11
@ayush-AI ayush-AI requested a review from Piumal1999 June 12, 2023 17:27
@ayush-AI ayush-AI marked this pull request as ready for review June 15, 2023 12:14
@ayush-AI
Copy link
Contributor Author

@Piumal1999 @jayasanka-sack @Anjula I was able to fix the failing test and also created two separate describes for the edit and registering a patient please check.

@denniskigen denniskigen changed the title (fix) O3-2081- Update tests for patient-registration component. (fix) O3-2081: Update tests for PatientRegistration component Jun 20, 2023
@denniskigen denniskigen changed the title (fix) O3-2081: Update tests for PatientRegistration component (test) O3-2081: Fix tests for the PatientRegistration component Jun 20, 2023
@denniskigen
Copy link
Member

There are still a whole bunch of warnings in the test output. It'd be great if we could address that @anjula-sack @ayush-AI.

@@ -1,9 +1,9 @@
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import { BrowserRouter as Router, useParams } from 'react-router-dom';
import { render, screen, fireEvent, waitFor, within } from '@testing-library/react';
Copy link
Member

@denniskigen denniskigen Jun 20, 2023

Choose a reason for hiding this comment

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

Here and elsewhere, we should use either fireEvent or useEvent. Not both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. Please check

@ayush-AI
Copy link
Contributor Author

In this PR I have removed some unwanted test from the input.test.tsx file. These test were not need as these test doesn't coincide with the actual implementation of the input.component.tsx.

Copy link
Collaborator

@anjula-sack anjula-sack left a comment

Choose a reason for hiding this comment

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

Good job! @ayush-AI

Copy link
Collaborator

@anjula-sack anjula-sack left a comment

Choose a reason for hiding this comment

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

@ayush-AI can you fix the conflicts?

…m-patient-management into patient-registration
@ayush-AI ayush-AI requested a review from anjula-sack July 4, 2023 12:19
Copy link
Collaborator

@Piumal1999 Piumal1999 left a comment

Choose a reason for hiding this comment

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

@ayush-AI, I added few comments.

Copy link
Collaborator

@Piumal1999 Piumal1999 left a comment

Choose a reason for hiding this comment

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

Good job @ayush-AI . Thank you

@Piumal1999 Piumal1999 requested review from anjula-sack and removed request for anjula-sack August 10, 2023 12:11
@Piumal1999
Copy link
Collaborator

Hi @anjula-sack , Could you please review and merge it? It seems like I don't have permission to merge it.

@Piumal1999 Piumal1999 merged commit 1950921 into openmrs:main Aug 18, 2023
6 of 7 checks passed
@ayush-AI ayush-AI deleted the patient-registration branch September 5, 2023 07:02
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.

5 participants