Skip to content
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

[ra-test] No way to use custom dataProvider as shown in the examples #6597

Closed
DjebbZ opened this issue Sep 20, 2021 · 3 comments
Closed

[ra-test] No way to use custom dataProvider as shown in the examples #6597

DjebbZ opened this issue Sep 20, 2021 · 3 comments

Comments

@DjebbZ
Copy link
Contributor

DjebbZ commented Sep 20, 2021

In the ra-test README, the last examples declare a custom dataProvider but then never use them. And <TestContext /> don't provide a way to pass a custom dataProvider (I've read the code).

Is this an unimplemented possibility ? A bug in the documentation ? Something missing ?

@djhi
Copy link
Collaborator

djhi commented Sep 20, 2021

This is indeed a documentation issue. TestContext does not even wrap anything with a DataProvider context. You have to do it yourself. Until we fix the documentation and/or provide more tools around this, you can refer to some our tests. For instance: https://github.com/marmelab/react-admin/blob/master/packages/ra-core/src/controller/useListController.spec.tsx#L59

@DjebbZ
Copy link
Contributor Author

DjebbZ commented Sep 20, 2021

Thanks for the pointer !

It kinda works because we now move the loaded/loading booleans correctly, but the total received inside our list is still undefined whatever I return from the fake dataProvider. I need to wrap my head around what's happening in useGetMainList.

@WiXSL
Copy link
Contributor

WiXSL commented Dec 3, 2021

Fixed by #6600

@WiXSL WiXSL closed this as completed Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants