-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
[BC Break] Remove ra-test #7148
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.
UnitTesting.md
Fix occurrences of getOne: jest.fn().resolve
with getOne: Promise.resolve
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.
UnitTesting.md
Fix occurrences of
const tabs = testUtils.queryByRole('tab'); expect(tabs.length).toEqual
with
const tabs = testUtils.queryAllByRole('tab'); expect(tabs).toHaveLength
Co-authored-by: Aníbal Svarcas <WiXSL@users.noreply.github.com>
Co-authored-by: Aníbal Svarcas <WiXSL@users.noreply.github.com>
## Spying on the store 'dispatch' | ||
|
||
If you are using `useDispatch` within your components, it is likely you will want to test that actions have been dispatched with the correct arguments. You can return the `store` being used within the tests using a `renderProp`. | ||
**Tip**: If you're using TypeScript, the compiler will complain about missing methods in the data provider above. You can remove these warnings by using the `testDataProvider` helper: |
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.
Unfortunately, TS will still complain when using the testDataProvider
because of the Record type. We have some work to do on this subject
You no longer need a special package to unit test your components. The
react-admin
package provides all you need.If you used
TestContext
from 'ra-test', useAdminContext
instead: