Skip to content

Commit 08c51b4

Browse files
authored
Correct Assert section in Example page (testing-library#513)
Assert section in Example page of React Testing Library does not contains assertion code but SUT. So rename the section to 'System Under Test' and insert a new section that describes assertion code correctly.
1 parent d379e55 commit 08c51b4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/react-testing-library/example-intro.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,16 @@ await waitFor(() =>
158158

159159
### Assert
160160

161+
```jsx
162+
// assert that the alert message is correct.
163+
expect(screen.getByRole('alert')).toHaveTextContent('Oops, failed to fetch!')
164+
165+
// assert that the button is not disabled.
166+
expect(screen.getByRole('button')).not.toHaveAttribute('disabled')
167+
```
168+
169+
### System Under Test
170+
161171
fetch.js
162172

163173
```jsx

0 commit comments

Comments
 (0)