Network Requests
+Network Requests
Introduction
Mocking network requests is an essential part of testing React Native applications. By mocking network diff --git a/12.x/cookbook/basics/async-tests.html b/12.x/cookbook/basics/async-tests.html index 05b9d3eb..ac9f3c26 100644 --- a/12.x/cookbook/basics/async-tests.html +++ b/12.x/cookbook/basics/async-tests.html @@ -4,23 +4,23 @@
Async tests
+Async tests
Summary
Typically, you would write synchronous tests, as they are simple and get the work done. However, there are cases when using asynchronous (async) tests might be necessary or beneficial. The two most common cases are:
-
diff --git a/12.x/cookbook/basics/custom-render.html b/12.x/cookbook/basics/custom-render.html
index c7f98ba1..c9842f97 100644
--- a/12.x/cookbook/basics/custom-render.html
+++ b/12.x/cookbook/basics/custom-render.html
@@ -4,23 +4,23 @@
renderfunction - render your UI components for testing purposes
diff --git a/12.x/docs/api/events/fire-event.html b/12.x/docs/api/events/fire-event.html
index 05f84ce0..a511d833 100644
--- a/12.x/docs/api/events/fire-event.html
+++ b/12.x/docs/api/events/fire-event.html
@@ -4,23 +4,23 @@
Custom render function
+ Custom render function
Summary
RNTL exposes the render function as the primary entry point for tests. If you make complex, repeating setups for your tests, consider creating a custom render function. The idea is to encapsulate common setup steps and test wiring inside a render function suitable for your tests.
Example
diff --git a/12.x/cookbook/index.html b/12.x/cookbook/index.html index 0b2d4c6b..908d247c 100644 --- a/12.x/cookbook/index.html +++ b/12.x/cookbook/index.html @@ -4,23 +4,23 @@Introduction
+Introduction
Welcome to the React Native Testing Library (RNTL) Cookbook! This app is your go-to resource for learning how to effectively test React Native applications. It provides a collection of best practices, ready-made recipes, and tips & tricks to diff --git a/12.x/cookbook/state-management/jotai.html b/12.x/cookbook/state-management/jotai.html index 700ce6bd..5e78335d 100644 --- a/12.x/cookbook/state-management/jotai.html +++ b/12.x/cookbook/state-management/jotai.html @@ -4,23 +4,23 @@
Jotai
+Jotai
Introduction
Jotai is a global state management library for React that uses an atomic approach to optimize renders and solve issues like extra re-renders and the need for memoization. It scales from simple diff --git a/12.x/docs/advanced/testing-env.html b/12.x/docs/advanced/testing-env.html index e403effe..ce939e53 100644 --- a/12.x/docs/advanced/testing-env.html +++ b/12.x/docs/advanced/testing-env.html @@ -4,23 +4,23 @@
Testing environment
+Testing environment
This document is intended for a more advanced audience who want to understand the internals of our testing environment better, e.g., to contribute to the codebase. You should be able to write integration or component tests without reading this.
React Native Testing Library allows you to write integration and component tests for your React Native app or library. While the JSX code used in tests closely resembles your React Native app, things are not as simple as they might appear. This document will describe the key elements of our testing environment and highlight things to be aware of when writing more advanced tests or diagnosing issues.
React renderers
diff --git a/12.x/docs/advanced/understanding-act.html b/12.x/docs/advanced/understanding-act.html index b143e259..f8e1e35d 100644 --- a/12.x/docs/advanced/understanding-act.html +++ b/12.x/docs/advanced/understanding-act.html @@ -4,23 +4,23 @@Understanding act function
+ Understanding act function
When writing RNTL tests one of the things that confuses developers the most are cryptic act() function errors logged into console. In this article I will try to build an understanding of the purpose and behaviour of act() so you can build your tests with more confidence.
act warnings
Let’s start with typical act() warnings logged to console. There are two kinds of these issues, let’s call the first one the "sync act()" warning:
API Overview
+API Overview
React Native Testing Library consists of following APIs:
Fire Event API
+Fire Event API
For common events like press or type it's recommended to use User Event API as it offers
diff --git a/12.x/docs/api/events/user-event.html b/12.x/docs/api/events/user-event.html
index 7328ed20..4ebb9435 100644
--- a/12.x/docs/api/events/user-event.html
+++ b/12.x/docs/api/events/user-event.html
@@ -4,23 +4,23 @@
User Event interactions
+User Event interactions
User Event interactions require RNTL v12.2.0 or later.
Comparison with Fire Event API
Fire Event is our original event simulation API. It can invoke any event handler declared on either host or composite elements. Suppose the element does not have onEventName event handler for the passed eventName event, or the element is disabled. In that case, Fire Event will traverse up the component tree, looking for an event handler on both host and composite elements along the way. By default, it will not pass any event data, but the user might provide it in the last argument.
Jest matchers
+Jest matchers
Built-in Jest matchers require RNTL v12.4.0 or later.
This guide describes built-in Jest matchers, we recommend using these matchers as they provide readable tests, accessibility support, and a better developer experience.
Setup
diff --git a/12.x/docs/api/misc/accessibility.html b/12.x/docs/api/misc/accessibility.html index bc23e041..8b15413d 100644 --- a/12.x/docs/api/misc/accessibility.html +++ b/12.x/docs/api/misc/accessibility.html @@ -4,23 +4,23 @@Accessibility
+Accessibility
isHiddenFromAccessibility
Also available as isInaccessible() alias for React Testing Library compatibility.
Async utilities
+Async utilities
findBy* queries
The findBy* queries are used to find elements that are not instantly available but will be added as a result of some asynchronous action. Learn more details here.
