Skip to content

Commit

Permalink
docs: fix typos and add link (#101)
Browse files Browse the repository at this point in the history
Fix types I left in the getByRole section also add getByRole in the usage section
  • Loading branch information
JeffBaumgardt authored and Kent C. Dodds committed Sep 16, 2018
1 parent f73c044 commit 09f1709
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ when a real user uses it.
- [`getByAltText`](#getbyalttext)
- [`getByTitle`](#getbytitle)
- [`getByValue`](#getbyvalue)
- [`getByRole`](#getbyrole)
- [`getByTestId`](#getbytestid)
- [`wait`](#wait)
- [`waitForElement`](#waitforelement)
Expand Down Expand Up @@ -361,15 +362,15 @@ getByRole(
exact?: boolean = true,
collapseWhitespace?: boolean = false,
trim?: boolean = true,
}): HTMLElement`
}): HTMLElement
```

A shortcut to `` container.querySelector(`[role="${yourRole}"]`) `` (and it
also accepts a [`TextMatch`](#textmatch)).

```javascript
// <div role="dialog">...</div>
const dialogContainer = getByTestrole(container, 'dialog')
const dialogContainer = getByRole(container, 'dialog')
```

### `getByTestId`
Expand Down

0 comments on commit 09f1709

Please sign in to comment.