-
-
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
feat: add prevent validateResponseFormat() from validating custom routes #8159
feat: add prevent validateResponseFormat() from validating custom routes #8159
Conversation
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.
The existing response validation logic is currently not tested, but I'd like that you add at least one test for this change. I'd put it in useDataProvider.spec.tsx
, and I'd test 3 cases:
- a call to
dataProvider.getList()
returning a response with the right format doesn't return any warning - a call to
dataProvider.getList()
returning a response without the right format does return any warning - a call to
dataProvider.custom()
returning a response without the right format doesn't return any warning
No need to document anything.
@@ -21,6 +21,11 @@ export const fetchActionsWithArrayOfRecordsResponse = [ | |||
]; | |||
export const fetchActionsWithTotalResponse = ['getList', 'getManyReference']; | |||
|
|||
export const fetchActions = [ |
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.
I'd name it reactAdminFetchActions
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 448a8ec
@oguhpereira you can use something like this to discard jest.spyOn(console, 'error').mockImplementationOnce(() => {}); |
|
Thanks! |
This pr makes an adjustment so that validateResponseFormat() is not used in dataProvider custom routes
Closes #8083
Obs: I need to understand what is needed to document and test