Skip to content

Commit 9049ec0

Browse files
authored
Merge pull request #53 from alexkrolick/rtl-streamline
react testing library tweaks
2 parents 8ace7de + 4a3cbc1 commit 9049ec0

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

docs/example-external.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,16 @@ title: External Examples
44
sidebar_label: External Examples
55
---
66

7-
You can find more react-testing-library examples at
8-
[react-testing-examples.com](https://react-testing-examples.com/jest-rtl/).
7+
## Code Samples
8+
9+
- You can find more react-testing-library examples at
10+
[react-testing-examples.com](https://react-testing-examples.com/jest-rtl/).
11+
12+
## Videos
13+
14+
- [What is React Testing Library?](https://youtu.be/JKOwJUM4_RM) by Scott
15+
Tolinski
16+
17+
<a href="https://youtu.be/JKOwJUM4_RM">
18+
<img width="200px" alt="what is react testing library" src='https://img.youtube.com/vi/JKOwJUM4_RM/0.jpg' style="margin-left: 36px" />
19+
</a>

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ test('loads and displays greeting', async () => {
4444
})
4545
```
4646

47-
## Imports
47+
---
48+
49+
## Step-By-Step
50+
51+
### Imports
4852

4953
```jsx
5054
// import dependencies
@@ -69,8 +73,6 @@ import axiosMock from 'axios'
6973
import Fetch from '../fetch'
7074
```
7175

72-
## Test
73-
7476
```jsx
7577
// automatically unmount and cleanup DOM after the test is finished.
7678
afterEach(cleanup)
@@ -84,8 +86,8 @@ test('loads and displays greeting', async () => {
8486

8587
### Arrange
8688

87-
The [`render`](./api#render) method renders a React
88-
element into the DOM and returns utility functions for testing the component.
89+
The [`render`](./api#render) method renders a React element into the DOM and
90+
returns utility functions for testing the component.
8991

9092
```jsx
9193
const url = '/greeting'

docs/react-testing-library/intro.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ facilitate testing implementation details). Read more about this in
6363
> NOTE: This library is built on top of [`dom-testing-library`](/) which is
6464
> where most of the logic behind the queries is.
6565
66-
## What is react-testing-library?
66+
## Video
6767

68-
Have a look at the video below for an explanation. <br/><br/>
69-
[![what is react testing library](https://img.youtube.com/vi/JKOwJUM4_RM/0.jpg)](https://youtu.be/JKOwJUM4_RM 'what is react testing library')
68+
Have a look at the "What is React Testing library?" video below for an
69+
introduction to the library.
70+
71+
<a href="https://youtu.be/JKOwJUM4_RM">
72+
<img width="200px" alt="what is react testing library" src='https://img.youtube.com/vi/JKOwJUM4_RM/0.jpg' style="margin-left: 0" />
73+
</a>

0 commit comments

Comments
 (0)