Maintainable
Write maintainable tests for your React Native apps.
diff --git a/12.x/cookbook/advanced/network-requests.html b/12.x/cookbook/advanced/network-requests.html index 5affba22..8e05c2ab 100644 --- a/12.x/cookbook/advanced/network-requests.html +++ b/12.x/cookbook/advanced/network-requests.html @@ -6,7 +6,7 @@
render functionact functionrenderHook functionrender functionscreen object

Write maintainable tests for your React Native apps.
Promotes testing public APIs and avoiding implementation details.
Supported by React Native community and its core contributors.
Mocking network requests is an essential part of testing React Native applications. By mocking
network
@@ -221,7 +221,7 @@ Please be minded that the MSW's setup guide is potentially incomplete and m
describe('PhoneBook', () => {
it('fetches all contacts and favorites successfully and renders lists in sections correctly', async () => {
- render(<PhoneBook />);
+ await render(<PhoneBook />);
await waitForElementToBeRemoved(() => screen.getByText(/users data not quite there yet/i));
expect(await screen.findByText('Name: Mrs Ida Kristensen')).toBeOnTheScreen();
@@ -290,7 +290,7 @@ More info can be found in ...
it('fails to fetch all contacts and renders error message', async () => {
mockServerFailureForGetAllContacts();
- render(<PhoneBook />);
+ await render(<PhoneBook />);
await waitForElementToBeRemoved(() => screen.getByText(/users data not quite there yet/i));
expect(
diff --git a/14.x/cookbook/basics/async-tests.html b/14.x/cookbook/basics/async-events.html
similarity index 76%
rename from 14.x/cookbook/basics/async-tests.html
rename to 14.x/cookbook/basics/async-events.html
index f3f6a36d..687ee657 100644
--- a/14.x/cookbook/basics/async-tests.html
+++ b/14.x/cookbook/basics/async-events.html
@@ -5,20 +5,21 @@
- Async tests
+