question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use real data provider for testing

See original GitHub issue

Is your feature request related to a problem? Please describe. I would like to enable my data provider for testing, so I can test my custom components and their side effects better (i.e. requests that are triggered). I’m using jest and react-testing-library and by default when I wrap the components I’d like to test using the <TestContext enableReducers> component, all data provider requests always respond with { data: null }.

Describe the solution you’d like I think it would be ideal to be able to pass the real data provider to the TestContext component so it will be used by the test application.

Describe alternatives you’ve considered I tried to rewrite the TestContext component and used my data provider. It never triggered any requests though and failed inside the react admin data reducer (for a create request inside the addOneRecord function, with newRecord set to null)

I’m not sure why my data provider wasn’t triggering any requests and ended up inside the react admin data reducer before doing so. With some guidance why this happened, I would be happy to implement this feature if it is doable.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:19 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
ValentinnDimitroffcommented, Mar 19, 2021

While adding the customReducers option I noticed the ReadME of ra-test package lacks some notes for the renderWithRedux function. Would you like me to add a section about it with some examples?

1reaction
djhicommented, Mar 19, 2021

Yes, it would be really appreciated. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use TestNg DataProviders (with Detailed ... - Tools QA
In the last tutorial, we discussed the TestNG Parameters and how to use them for passing the values to your test class from...
Read more >
How To Use DataProviders In TestNG [With Examples]
DataProvider in TestNG is used to inject multiple values into the same test case, this guide explains how to use them in your...
Read more >
Run Selenium Tests using DataProvider & TestNG
Learn how to run automated tests for Data Provider in Selenium TestNG with examples to provide complex parameters in the test methods.
Read more >
Dataprovider & TestNG XML: Parameterization in Selenium ...
It is a strategy of execution which automatically runs test cases multiple times using different values. The concept achieved by parameterizing ...
Read more >
How to Use DataProvider in TestNG + Basic Annotations
Start learning the basics of DataProvider and how it can be used in TestNG to improve your automated testing.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found