hospitalrun-frontend
hospitalrun-frontend copied to clipboard
NewLabRequest.test.tsx is flaky
Please read this entire template before posting any issue. If you ignore these instructions
and post an issue here that does not follow the instructions, your issue might be closed,
locked, and assigned the missing discussion
label.
🐛 Bug Report
The NewLabRequest form layout › should clear visit when patient is changed
test spuriously times out. In addition, on save › should save the lab request and navigate to "/labs/:id"
spuriously has visitsInput
assume a display value of [""]
instead of the desired string. The test output is included below.
To Reproduce
Steps to reproduce the behavior:
Run npm run test:ci src/__tests__/labs/requests/NewLabRequest.test.tsx
several times until you encounter the error.
Paste your code here:
New Lab Request › on save › should save the lab request and navigate to "/labs/:id"
expect(element).toHaveDisplayValue()
Expected element to have display value:
visit_type at 2021-04-18 01:58 PM
Received:
[""]
157 | }),
158 | )
> 159 | expect(visitsInput).toHaveDisplayValue(
| ^
160 | `${expectedVisits[0].type} at ${format(
161 | new Date(expectedVisits[0].startDateTime),
162 | 'yyyy-MM-dd hh:mm a',
Expected behavior
All the tests should pass.
Your Environment
- node version: v12.18.4
- os: Mac
@DrewGregory Are you going to be working on this?
I have not taken this on yet. If someone would like to take this on, feel free to add a comment to this task, and we can assign the issue to you. Otherwise, I might take this on once we wrap up some other HR GitHub issues.
I ran the test 6 times but didn't encounter the bug
I'll try to fix this issue if that's ok