Skip to content

react testing library tweaks #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions docs/example-external.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,16 @@ title: External Examples
sidebar_label: External Examples
---

You can find more react-testing-library examples at
[react-testing-examples.com](https://react-testing-examples.com/jest-rtl/).
## Code Samples

- You can find more react-testing-library examples at
[react-testing-examples.com](https://react-testing-examples.com/jest-rtl/).

## Videos

- [What is React Testing Library?](https://youtu.be/JKOwJUM4_RM) by Scott
Tolinski

<a href="https://youtu.be/JKOwJUM4_RM">
<img width="200px" alt="what is react testing library" src='https://img.youtube.com/vi/JKOwJUM4_RM/0.jpg' style="margin-left: 36px" />
</a>
12 changes: 7 additions & 5 deletions docs/react-testing-library/example-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ test('loads and displays greeting', async () => {
})
```

## Imports
---

## Step-By-Step

### Imports

```jsx
// import dependencies
Expand All @@ -69,8 +73,6 @@ import axiosMock from 'axios'
import Fetch from '../fetch'
```

## Test

```jsx
// automatically unmount and cleanup DOM after the test is finished.
afterEach(cleanup)
Expand All @@ -84,8 +86,8 @@ test('loads and displays greeting', async () => {

### Arrange

The [`render`](./api#render) method renders a React
element into the DOM and returns utility functions for testing the component.
The [`render`](./api#render) method renders a React element into the DOM and
returns utility functions for testing the component.

```jsx
const url = '/greeting'
Expand Down
10 changes: 7 additions & 3 deletions docs/react-testing-library/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ facilitate testing implementation details). Read more about this in
> NOTE: This library is built on top of [`dom-testing-library`](/) which is
> where most of the logic behind the queries is.

## What is react-testing-library?
## Video

Have a look at the video below for an explanation. <br/><br/>
[![what is react testing library](https://img.youtube.com/vi/JKOwJUM4_RM/0.jpg)](https://youtu.be/JKOwJUM4_RM 'what is react testing library')
Have a look at the "What is React Testing library?" video below for an
introduction to the library.

<a href="https://youtu.be/JKOwJUM4_RM">
<img width="200px" alt="what is react testing library" src='https://img.youtube.com/vi/JKOwJUM4_RM/0.jpg' style="margin-left: 0" />
</a>