-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Sidebar: Unable to write unit test: groupToDisplayedElements[group].findLastIndex is not a function
#5954
Comments
Its because of https://github.com/primefaces/primereact/blob/master/components/lib/hooks/useDisplayOrder.js It looks like something needs to be initialized? |
Before submitting the bug I tried wrapping the test in |
Can you submit a PR with test showing the issue? |
I can for sure try. Is there a guide on where to start? |
We have other tests. You just need to create a spec.js file similar to this test of the Chip component components/lib/chip/Chip.spec.js |
Thank you for your help. I was able to reproduce with the following:
I am not at my work station that is set up with all my git keys, but I will create a PR tomorrow. |
@melloware I figured out the problem. The issue was not with the implementation of the hook, rather, that I was on NodeJS v16. I am happy to still create a PR with the .spec file if you like, but other than that, I consider this resolved. |
Yes i would still love a spec file! |
PR created, but I am having a hard time linking it to this issue correctly. |
* Add a test for the sidebar component. * Update Sidebar.spec.js --------- Co-authored-by: Melloware <[email protected]>
@melloware Thank you for all your help! |
thanks for the PR! |
Describe the bug
I have written some wrapper components around Primereact and updating from 10.3.0 to 10.3.1 causes my
vi-test
/testing-library
tests for the sidebar to fail with the following error:Here is a basic test using the Primereact sidebar component straight from the box that shows the problem:
As far as I can tell, all the assertions in the test complete successfully, but then there is a problem unmounting the component.
Reproducer
No response
PrimeReact version
10.3.1
React version
17.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: