-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependency @testing-library/dom to v8.7.1 (#265)
Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Caleb Eby <caleb.eby01@gmail.com>
- Loading branch information
1 parent
1fb7a3c
commit 2b92fbc
Showing
9 changed files
with
130 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
'pleasantest': minor | ||
--- | ||
|
||
Update `@testing-library/dom` to [`v8.11.1`](https://github.com/testing-library/dom-testing-library/releases/tag/v8.11.1) | ||
|
||
Read their [release notes](https://github.com/testing-library/dom-testing-library/releases) for all the versions between 8.1.0 and 8.11.1 to see the full changes. | ||
|
||
Notably, we have added the ability for TypeScript users to optionally specify an element type as a type parameter for DTL queries: | ||
|
||
```ts | ||
import { withBrowser } from 'pleasantest'; | ||
|
||
test( | ||
'changelog example', | ||
withBrowser(async ({ screen }) => { | ||
// ElementHandle<HTMLButtonElement> | ||
const button = await screen.getByRole<HTMLButtonElement>(/button/); | ||
|
||
// ElementHandle<HTMLButtonElement>[] | ||
const buttons = await screen.getAllByRole<HTMLButtonElement>(/button/); | ||
}), | ||
); | ||
``` | ||
|
||
The return type is automatically determined based on the specified element type. Since Pleasantest DTL queries return `ElementHandle`s, the return type will be wrapped with `Promise<ElementHandle<...>>`. For queries which return arrays of elements, the singular version of the element type is accepted as the type parameter, and the return type will automatically be wrapped with `Promise<Array<ElementHandle<...>>>`. |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters