react-testing-library
react-testing-library copied to clipboard
🐐 Simple and complete React DOM testing utilities that encourage good testing practices.
How to mock event handler function defined on parent component and geting invoked on child component
- `@testing-library/react` version: - Testing Framework and version: - DOM Environment: ### Relevant code or config: This is my code below. onContinue and onLogout eventhandler functions defined in parent comp...
- `@testing-library/react` version: 13.1.1 - Testing Framework and version: jest 27.5.1 - DOM Environment: jest-dom 27.5.1 ### Relevant code or config: ```js const handleSavedCardPayment = () => { const paymentInfo...
### Problem description: - Having multiple versions of `@testing-library/dom` in the same project leads to bugs that are hard to catch, like [confusing act warnings](https://github.com/testing-library/react-testing-library/issues/1051) - To avoid this, we...
**What**: This is a bugfix (as far as I can tell). **Why**: `render()` by default appends a new `container` to a `baseElement` which is, by default, the global variable `document.body`....
- `@testing-library/react` version: latest - Testing Framework and version: Jest (latest) - DOM Environment: jsdom - Minimal repro: https://github.com/stefee/react-testing-library-repro-1068 I'm finding that when an error is thrown from inside an...
- `@testing-library/react` version: @testing-library/[email protected] - Testing Framework and version: jest through [email protected] - DOM Environment: [email protected] (through react-scripts) - node v12.18.0 ### Relevant code or config: ```js const selectOne =...
Edit: [Skip comments about debugging and jump to the root cause](https://github.com/testing-library/react-testing-library/issues/865#issuecomment-792248495). > - If your issue is regarding one of the query APIs (`getByText`, > `getByLabelText`, etc), then please file...
### Describe the feature you'd like: 1. Similar to [recent efforts at `dom-testing-library`](https://github.com/testing-library/dom-testing-library/issues/494) to migrate the codebase to TS, the motivations for the same migration happening to this library apply...
- `@testing-library/react` version: "@testing-library/react": "^10.4.8", - Testing Framework and version: "jest": "^26.3.0", "ts-jest": "^26.2.0", - DOM Environment: "@testing-library/jest-dom": "^5.11.2", "react": "^16.13.0", ### Relevant code or config: **FULL CODE SANDBOX:** https://codesandbox.io/s/silly-hertz-1v1uq...
I've used Testing Library for a while and absolutely love it; I think it's a fantastic library so firstly a big thank you. I should preface this by saying that...