-
Notifications
You must be signed in to change notification settings - Fork 211
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
Conversation
packages/esm-patient-registration-app/src/patient-registration/patient-registration.test.tsx
Show resolved
Hide resolved
@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. |
packages/esm-patient-registration-app/src/patient-registration/patient-registration.test.tsx
Show resolved
Hide resolved
PatientRegistration
component
PatientRegistration
componentPatientRegistration
component
packages/esm-patient-registration-app/src/patient-registration/patient-registration.test.tsx
Outdated
Show resolved
Hide resolved
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'; |
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.
Here and elsewhere, we should use either fireEvent
or useEvent
. Not both.
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.
done. Please check
packages/esm-patient-registration-app/src/patient-registration/patient-registration.test.tsx
Outdated
Show resolved
Hide resolved
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. |
d1d9a20
to
2d4786b
Compare
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.
Good job! @ayush-AI
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.
@ayush-AI can you fix the conflicts?
…-management into patient-registration
…m-patient-management into patient-registration
packages/esm-patient-registration-app/src/patient-registration/patient-registration.test.tsx
Outdated
Show resolved
Hide resolved
…-management into patient-registration
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.
@ayush-AI, I added few comments.
...es/esm-patient-registration-app/src/patient-registration/field/name/name-field.component.tsx
Outdated
Show resolved
Hide resolved
...esm-patient-registration-app/src/patient-registration/input/basic-input/input/input.test.tsx
Show resolved
Hide resolved
packages/esm-patient-registration-app/src/patient-registration/patient-registration.test.tsx
Outdated
Show resolved
Hide resolved
…-management into patient-registration
7dd10fc
to
5518fa5
Compare
…-management into patient-registration
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.
Good job @ayush-AI . Thank you
Hi @anjula-sack , Could you please review and merge it? It seems like I don't have permission to merge it. |
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.