jest-dom
jest-dom copied to clipboard
:owl: Custom jest matchers to test the state of the DOM
------------ π Click "Preview"! Issues on GitHub are intended to be related to problems with the library itself and feature requests so we recommend not using this medium to ask...
**What**: This PR replaces `chalk` with [`picocolors`](https://github.com/alexeyraspopov/picocolors). **Why**: Picocolors is smaller and faster. For a reference see https://github.com/es-tooling/ecosystem-cleanup/issues/132. **How**: Uninstalled `chalked`, and installed `picocolors`. Renamed the import **Checklist**: - [...
- `@testing-library/jest-dom` version: latest ### Relevant code or config: The following assertions will always pass if the element doesn't have that CSS property set in `style`: ```js expect(element).toHaveStyle("border: fakefake"); expect(element).toHaveStyle("background:...
**What**: Replaces chalk and its dependencies, 94 KB of unpacked size in total, with picocolors, doing the same thing, but under 1 KB. **Why**: Part of the [e18e initiative](https://e18e.dev/). **How**:...
**What**: Fixed a typo in toBeValid method **Why**: I am relatively new to aria and was confused when toBeValid method said that the element is invalid when aria-invalid is set...
Chalk v4 was released in 2020: https://github.com/chalk/chalk/releases/tag/v4.0.0 It would be great to upgrade so consumers don't have to download multiple versions of this dependency (itβs a common transitive dependency). There...
I believe there may be a bug in `isElementOrAncestorDisabled`: https://github.com/testing-library/jest-dom/blob/918b6fbcde10d4409ee8f05c6e4eecbe96a72b7a/src/to-be-disabled.js#L64C10-L64C37 and the function should be written like this instead: ```TSX function isElementOrAncestorDisabled(element) { return ( canElementBeDisabled(element) && (isElementDisabled(element) || (!element.hasAttribute('disabled')...
I think that using toBeVisible is correctly when you want get to know element is visible or not for user. But that method is using getComputedStyle, but my tailwind classes...
**What**: Simple documentation change. **Why**: See line 177 for context as to why I'm submitting this. The file names are currently mismatched which is something I can see throwing people...