diff --git a/.all-contributorsrc b/.all-contributorsrc index ac7bafbc..ebb53535 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -314,6 +314,16 @@ "contributions": [ "code" ] + }, + { + "login": "JeffBaumgardt", + "name": "Jeff Baumgardt", + "avatar_url": "https://avatars2.githubusercontent.com/u/777527?v=4", + "profile": "https://github.com/JeffBaumgardt", + "contributions": [ + "code", + "doc" + ] } ] } diff --git a/README.md b/README.md index 560d7831..a163be37 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ [![downloads][downloads-badge]][npmtrends] [![MIT License][license-badge]][license] -[![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-32-orange.svg?style=flat-square)](#contributors) [![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc] @@ -351,6 +351,27 @@ Returns the element that has the matching value. const lastNameInput = getByValue('Norris') ``` +### `getByRole` + +```typescript +getByRole( + container: HTMLElement, + text: TextMatch, + options?: { + exact?: boolean = true, + collapseWhitespace?: boolean = false, + trim?: boolean = true, + }): HTMLElement` +``` + +A shortcut to `` container.querySelector(`[role="${yourRole}"]`) `` (and it +also accepts a [`TextMatch`](#textmatch)). + +```javascript +//