Skip to content

Commit 1a43fc5

Browse files
committed
docs: tweaks
1 parent 01d5050 commit 1a43fc5

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

website/docs/JestMatchers.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ id: jest-matchers
33
title: Jest Matchers
44
---
55

6+
:::note
7+
Built-in Jest matchers require RNTL v12.4.0 or later.
8+
:::
9+
610
This guide describes built-in Jest matchers, we recommend using these matchers as they provide more readable tests, better accessibility support and better developer experience.
711

8-
If you are already using legacy Jest Native matchers we have a [migration guide](MigrationJestMatchers.md) for moving to the built-in matchers.
12+
If you are already using legacy Jest Native matchers we have a [migration guide](migration-jest-native) for moving to the built-in matchers.
913

1014
import TOCInline from '@theme/TOCInline';
1115

website/docs/MigrationJestMatchers.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: migration-jest-native
33
title: Migration from Jest Native matchers
44
---
55

6-
This guide describes steps necessary to migrate from [legacy Jest Native matchers](https://github.com/testing-library/jest-native) `v5` to [built-in Jest matchers](JestMatchers.md).
6+
This guide describes steps necessary to migrate from [legacy Jest Native matchers](https://github.com/testing-library/jest-native) `v5` to [built-in Jest matchers](jest-matchers).
77

88
import TOCInline from '@theme/TOCInline';
99

@@ -45,32 +45,32 @@ expect(element).legacy_toHaveAccessibilityState({ busy: true });
4545
### Matchers not requiring changes
4646

4747
Following matchers should work the same:
48-
* [`toBeEmptyElement()`](JestMatchers.md#tobeemptyelement)
49-
* [`toBeEnabled()` / `toBeDisabled()`](JestMatchers.md#tobeenabled)
50-
* [`toBeOnTheScreen()`](JestMatchers.md#tobeonthescreen)
51-
* [`toBeVisible()`](JestMatchers.md#tobevisible)
52-
* [`toContainElement()`](JestMatchers.md#tocontainelement)
53-
* [`toHaveDisplayValue()`](JestMatchers.md#tohavedisplayvalue)
54-
* [`toHaveProp()`](JestMatchers.md#tohaveprop)
55-
* [`toHaveStyle()`](JestMatchers.md#tohavestyle)
56-
* [`toHaveTextContent()`](JestMatchers.md#tohavetextcontent)
48+
* [`toBeEmptyElement()`](jest-matchers#tobeemptyelement)
49+
* [`toBeEnabled()` / `toBeDisabled()`](jest-matchers#tobeenabled)
50+
* [`toBeOnTheScreen()`](jest-matchers#tobeonthescreen)
51+
* [`toBeVisible()`](jest-matchers#tobevisible)
52+
* [`toContainElement()`](jest-matchers#tocontainelement)
53+
* [`toHaveDisplayValue()`](jest-matchers#tohavedisplayvalue)
54+
* [`toHaveProp()`](jest-matchers#tohaveprop)
55+
* [`toHaveStyle()`](jest-matchers#tohavestyle)
56+
* [`toHaveTextContent()`](jest-matchers#tohavetextcontent)
5757

5858
### Renamed matchers
5959

60-
`toHaveAccessibilityValue()` matcher has been renamed to [`toHaveAccessibleValue()`](JestMatchers.md#tohaveaccessiblevalue) but otherwise should work the same.
60+
`toHaveAccessibilityValue()` matcher has been renamed to [`toHaveAccessibleValue()`](jest-matchers#tohaveaccessiblevalue) but otherwise should work the same.
6161

6262
### Removed matchers
6363

6464
`toHaveAccessibilityState()` matcher has been replaced by following matchers:
65-
* enabled state: [`toBeEnabled()` / `toBeDisabled()`](JestMatchers.md#tobeenabled)
66-
* checked state: [`toBeChecked()` / `toBePartiallyChecked()`](JestMatchers.md#tobechecked)
67-
* selected state: [`toBeSelected()`](JestMatchers.md#tobeselected)
68-
* expanded state: [`toBeExpanded()` / `toBeCollapsed()`](JestMatchers.md#tobeexpanded)
69-
* busy state: [`toBeBusy()`](JestMatchers.md#tobebusy)
65+
* enabled state: [`toBeEnabled()` / `toBeDisabled()`](jest-matchers#tobeenabled)
66+
* checked state: [`toBeChecked()` / `toBePartiallyChecked()`](jest-matchers#tobechecked)
67+
* selected state: [`toBeSelected()`](jest-matchers#tobeselected)
68+
* expanded state: [`toBeExpanded()` / `toBeCollapsed()`](jest-matchers#tobeexpanded)
69+
* busy state: [`toBeBusy()`](jest-matchers#tobebusy)
7070

7171
The new matchers support both `accessbililityState` and `aria-*` props.
7272

7373
You should be aware of following changes:
74-
* [`toBeEnabled()` / `toBeDisabled()`](JestMatchers.md#tobeenabled) matchers also check the disabled state for element ancestors and not only the element itself
75-
* [`toBeChecked()`](JestMatchers.md#tobechecked) matcher supports only elements with `checkbox` or `radio` role
76-
* [`toBePartiallyChecked()`](JestMatchers.md#tobechecked) matchers supports only elements with `checkbox` role
74+
* [`toBeEnabled()` / `toBeDisabled()`](jest-matchers#tobeenabled) matchers also check the disabled state for element ancestors and not only the element itself
75+
* [`toBeChecked()`](jest-matchers#tobechecked) matcher supports only elements with `checkbox` or `radio` role
76+
* [`toBePartiallyChecked()`](jest-matchers#tobechecked) matchers supports only elements with `checkbox` role

0 commit comments

Comments
 (0)