-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix type error when queryOptions enable is set to false #7987
Fix type error when queryOptions enable is set to false #7987
Conversation
Thanks for the error report and the PR! Would you mind trying to add a unit test for this case? |
c0feff5
to
a19f36f
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.
Thanks!
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.
Thanks!
Fixing failed unit test might be cumbersome 🤔. I have run it on the local machine and out of 10 tests on unchanged code:
|
I couldn't find the exact reason why the test
If that is ok with you I will make a commit fixing it. Snapshot of the mock requests that cause the test to fail:
|
Hi |
141ef5c
to
7e3a214
Compare
Could you resolve the conflict? |
7e3a214
to
60b18a5
Compare
@@ -109,6 +109,7 @@ export const useListController = <RecordType extends RaRecord = any>( | |||
useEffect(() => { | |||
if ( | |||
query.page <= 0 || | |||
data == null || |
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.
Tests might be failing because you trigger setPage(1)
even though you are already on page 1, which causes store to update and might trigger a re-render.
To me, you should rather move data == null
alongside with data?.length === 0
in the line below.
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.
Thanks for the info. I will check it soon.
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.
Changed it as you suggested and seems it's working now. However on my machine, some tests are failing, but they are failing on the master branch as well.
unit test that fail: "should apply validation to both itself and its inner inputs"
e2e tests that fail: "should validate ArrayInput", and sometimes "should have tabbable menu items"
Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
60b18a5
to
54c1ef4
Compare
Thanks! |
Fixes #7986