Skip to content

Commit b3ff6b6

Browse files
committed
clean up
1 parent 6f506b0 commit b3ff6b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

versioned_docs/version-7.x/testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ test('navigates to settings by tab bar button press', () => {
346346

347347
We get settings tab bar button, press it and check if rendered content is correct.
348348

349-
To find settings tab bar button you cannot use `queryByText`, because there is no text that can be queried. You can use `getByRole` instead and pass object with `name` prop as the second argument.
349+
To find settings tab bar button you cannot use `queryByText`, because there is no text that can be queried. You can use `getByRole` instead and pass object with `name` as the second argument.
350350

351351
```js
352352
// Pass object with settings tab name
@@ -861,7 +861,7 @@ test('Display loading state while waiting for data and then fetched profile nick
861861
</TabItem>
862862
</Tabs>
863863

864-
We query tab buttons and mock fetch function using `spyOn` and `mockImplementation`. We navigate to profile screen and check if loading state is rendered correctly. Then, to check if fetched data is displayed, we use `findByText` - we need to wait for the fetch to finish before checking it's result. To ensure that operation will succeed not only on first focus, we navigate back to home, then to settings and check loading state and fetched data again.
864+
We query tab buttons and mock fetch function using `spyOn` and `mockImplementation`. We navigate to profile screen and check if loading state is rendered correctly. Then, to check if fetched data is displayed, we use `findByText` - we need to wait for the fetch to finish before checking it's result. To ensure that operation will succeed not only on the first focus, we navigate back to home, then to settings and check loading state and fetched data again.
865865

866866
To make test deterministic and isolate it from the real backend you can mock fetch function. You can use `spyOn` to override real implementation of fetch with `mockedFetch`.
867867

0 commit comments

Comments
 (0)