hospitalrun-frontend icon indicating copy to clipboard operation
hospitalrun-frontend copied to clipboard

Duplicate Patient Modal cannot be triggered

Open nobrayner opened this issue 5 years ago • 10 comments

🐛 Bug Report

While converting NewPatient.test.tsx to RTL, we found that the "Duplicate Patient Modal" is impossible to trigger by a user. It looks like it performs a de-dupe against the redux store, but there is nothing that ever populates that store with patients? Thus de-dupe never finds a duplicate.

Creating based on comment in https://github.com/HospitalRun/hospitalrun-frontend/pull/2516#issuecomment-753378004

To Reproduce

Uncomment the "Duplicate Patient Modal" test and run it.

Expected behavior

The test would pass.

nobrayner avatar Jan 14 '21 22:01 nobrayner

@jackcmeyer Creating this based on the comment in #2516

nobrayner avatar Jan 14 '21 22:01 nobrayner

@nobrayner Are you working on a solution for this?

cc @jackcmeyer @tehKapa

morrme avatar Feb 09 '21 18:02 morrme

@morrme no I am not - this was raised as an extra task above and beyond the conversion to RTL

nobrayner avatar Feb 09 '21 20:02 nobrayner

Hi! If no one's working on this issue I'd be keen to work on it

acrawford13 avatar Apr 12 '21 00:04 acrawford13

Hello,

Looks like this issue is unassigned at the moment -- I'd like to work on it if that is the case. Thanks!

Giaddon avatar May 30 '21 19:05 Giaddon

Hi, could I be assigned to this issue if there's still help wanted?

connordmccandless avatar Oct 10 '21 02:10 connordmccandless

@connordmccandless sure

matteovivona avatar Oct 10 '21 13:10 matteovivona

I fixed the duplicate patient modal so that from the UI, if you're trying to add a patient that could be a duplicate, the modal properly displays. However, I'm having trouble with the test. It seems to me that the test always fails. I changed the code to mark every new patient as a duplicate, so that from the UI, any patient added would prompt the duplicate patient modal. However, the test still did not say that it found the duplicate patient modal, and did not pass.

I was wondering if someone who's more knowledgeable about the testing libraries could take a look at the tests in NewPatient.test.sx and see if they should be functional.

connordmccandless avatar Oct 20 '21 03:10 connordmccandless

thanks for the update @connordmccandless. create PR and then we'll see

matteovivona avatar Oct 20 '21 09:10 matteovivona

@tehKapa PR is created and attached to this issue

connordmccandless avatar Oct 21 '21 01:10 connordmccandless