jest-dom
jest-dom copied to clipboard
:owl: Custom jest matchers to test the state of the DOM
- `@testing-library/react` version: 13.4.0 - Testing Framework and version: `"jest": "^29.1.2"`, - DOM Environment: `"jest-environment-jsdom": "^29.1.2"`, `"@testing-library/jest-dom": "^5.16.5"` ### What you did: I have a Input Text Component setup which...
**What**: The non-semantic HTML element fails `toBeRequired` method even though aria-required is set as `true` - #481 It does not implement this part of what's [documented in MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-required): > When...
- `@testing-library/jest-dom` version: 6.4.2 - `node` version: 20.11.1 - `vitest` version: 1.4.0 - `npm` version: 10.5.0 ### Relevant code or config: ```js render(); const button = screen.getByRole('button'); expect(button).toHaveStyles({ 'background-color': '#5FA00C'...
**What**: I created convertCssObject that assigns correct properties and values, and called getStyleDeclaration before it. **Why**: In the haveToStyle method, when given a property is in camelCase and the value...
**What**: This PR [extends Vitest's default `Assertion` interface](https://vitest.dev/guide/extending-matchers.html#:~:text=If%20you%20are%20using%20TypeScript%2C%20since%20Vitest%200.31.0%20you%20can%20extend%20default%20Assertion%20interface%20in%20an%20ambient%20declaration%20file%20(e.g%3A%20vitest.d.ts)%20with%20the%20code%20below%3A) to fix the `toBeInTheDocument` ts error when using Vitest (#515). **Why**: I don't know (still cannot reproduce #515 on my own computer)....
- `@testing-library/jest-dom` version: 6.4.2 - `node` version: 20.11.1 - `jest` version: 29.7.0 - `npm` version: 10.2.4 ### What happened: Jest fails with a memory leak error when importing @testing-library/jest-dom into...
**What**: I noticed that the link to Kent C. Dodds course **How to Contribute to an Open Source Project on GitHub** was broken so checked the repo for broken links...
- `@testing-library/jest-dom` version: 6.4.5 - `node` version: 20.12.0 - `jest` (or `vitest`) version: 29.7.0 - `npm` (or `yarn`) version: 10.5.0 ### Relevant code or config: ### What you did: Tried...
Adds @jantimon as a contributor for bug. This was requested by gnapse [in this comment](https://github.com/testing-library/jest-dom/pull/602#issuecomment-2160796679)
- `@testing-library/jest-dom` version: 6.5.0 - `node` version: 20.15.1 - `jest` (or `vitest`) version: Vitest 2.0.5 - `npm` (or `yarn`) version: npm 10.8.2 ### Relevant code or config: See reproduction repo...