Skip to content

Commit a98a2fa

Browse files
committed
.
1 parent 409bfbd commit a98a2fa

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

website/docs/14.x/docs/guides/common-mistakes.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This guide outlines some common mistakes people make when using React Native Tes
1010

1111
## Not using Testing Library ESLint plugins {#not-using-testing-library-eslint-plugins}
1212

13-
**Importance: high**
13+
**Importance: medium**
1414

1515
There's an ESLint plugin for Testing Library: [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library). This plugin can help you avoid common mistakes and will automatically fix your code in many cases.
1616

@@ -57,7 +57,7 @@ This works fine, but it's more conventional to name it something more descriptiv
5757

5858
## Using cleanup {#using-cleanup}
5959

60-
**Importance: low**
60+
**Importance: medium**
6161

6262
React Native Testing Library automatically cleans up after each test. You don't need to call `cleanup()` manually unless you're using the `pure` export (which doesn't include automatic cleanup).
6363

@@ -121,7 +121,7 @@ Using `screen` has several benefits:
121121

122122
## Using the wrong assertion {#using-the-wrong-assertion}
123123

124-
**Importance: medium**
124+
**Importance: high**
125125

126126
React Native Testing Library provides built-in Jest matchers. Make sure you're using the right ones:
127127

@@ -332,7 +332,7 @@ Note: React Native supports both ARIA-compatible (`role`) and traditional (`acce
332332

333333
## Adding aria-, role, and other accessibility attributes incorrectly {#adding-aria-role-and-other-accessibility-attributes-incorrectly}
334334

335-
**Importance: medium**
335+
**Importance: high**
336336

337337
React Native supports ARIA-compatible attributes. Use them correctly:
338338

@@ -419,7 +419,7 @@ test('uses userEvent', async () => {
419419

420420
## Using query\* variants for anything except checking for non-existence {#using-query-variants-for-anything-except-checking-for-non-existence}
421421

422-
**Importance: medium**
422+
**Importance: high**
423423

424424
Use `queryBy*` only when checking that an element doesn't exist:
425425

@@ -448,7 +448,7 @@ test('checks non-existence', async () => {
448448

449449
## Using waitFor to wait for elements that can be queried with find\* {#using-waitfor-to-wait-for-elements-that-can-be-queried-with-find}
450450

451-
**Importance: medium**
451+
**Importance: high**
452452

453453
Use `findBy*` queries instead of `waitFor` + `getBy*`:
454454

@@ -486,7 +486,7 @@ test('waits for element', async () => {
486486

487487
## Passing an empty callback to waitFor {#passing-an-empty-callback-to-waitfor}
488488

489-
**Importance: low**
489+
**Importance: high**
490490

491491
Don't pass an empty callback to `waitFor`:
492492

@@ -509,7 +509,7 @@ test('waits correctly', async () => {
509509

510510
## Having multiple assertions in a single waitFor callback {#having-multiple-assertions-in-a-single-waitfor-callback}
511511

512-
**Importance: medium**
512+
**Importance: low**
513513

514514
Keep `waitFor` callbacks focused on a single assertion:
515515

@@ -593,7 +593,7 @@ test('avoids side effects in waitFor', async () => {
593593

594594
## Using get\* variants as assertions {#using-get-variants-as-assertions}
595595

596-
**Importance: medium**
596+
**Importance: low**
597597

598598
`getBy*` queries throw errors when elements aren't found, so they work as assertions. However, for better error messages, you might want to combine them with explicit matchers:
599599

0 commit comments

Comments
 (0)