Skip to content

Commit 324a529

Browse files
docs(prefer-expect-query-by): fix typo (#23)
* Fix typo * Update docs/rules/prefer-expect-query-by.md Co-Authored-By: Thomas Lombart <[email protected]>
1 parent 260f849 commit 324a529

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/rules/prefer-expect-query-by.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disallow the use of `expect(getBy*)` (prefer-expect-query-by)
22

3-
The (DOM) Testing Library support three types of queries: `getBy*` and `queryBy*`. Using `getBy*` throws an error in case the element is not found. This is useful when using method like `waitForElement`, which are `async` functions that will wait for the element to be found until a certain timeout, after that the test will fail.
3+
The (DOM) Testing Library allows to query DOM elements using different types of queries such as `getBy*` and `queryBy*`. Using `getBy*` throws an error in case the element is not found. This is useful when using method like `waitForElement`, which are `async` functions that will wait for the element to be found until a certain timeout, after that the test will fail.
44
However, when trying to assert if an element is not in the document, we can't use `getBy*` as the test will fail immediately. Instead it is recommended to use `queryBy*`, which does not throw and therefore we can assert that e.g. `expect(queryByText("Foo")).not.toBeInTheDocument()`.
55

66
> The same applies for the `getAll*` and `queryAll*` queries.

0 commit comments

Comments
 (0)