Skip to content

chore: tweak v13 docs #1694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# User Event interactions

:::info RNTL minimal version

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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Jest matchers

:::info RNTL minimal version

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Default [debug options](#debug) to be used when calling `debug()`. These default

### `concurrentRoot` option

Set to `true` to enable concurrent rendering used in the React Native New Architecture. Otherwise `render` will default to legacy synchronous rendering.
Set to `false` to disable concurrent rendering.
Otherwise, `render` will default to using concurrent rendering used in the React Native New Architecture.

## `resetToDefaults()`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ This option allows you to wrap the tested component, passed as the first option

#### `concurrentRoot` option

Set to `true` to enable concurrent rendering used in the React Native New Architecture. Otherwise `render` will default to legacy synchronous rendering.
Set to `false` to disable concurrent rendering.
Otherwise, `render` will default to using concurrent rendering used in the React Native New Architecture.

#### `createNodeMock` option

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ All of the built-in Jest matchers provided by the React Native Testing Library s

## Usage

You can use the built-in matchers by adding the following line to your `jest-setup.ts` file (configured using [`setupFilesAfterEnv`](https://jestjs.io/docs/configuration#setupfilesafterenv-array)):

```ts title=jest-setup.ts
import '@testing-library/react-native/extend-expect';
```
You don't need to do anything to use the built-in matchers. They are automatically available when you import anything from `@testing-library/react-native`.

### Gradual migration

Expand All @@ -23,7 +19,6 @@ You can use the built-in matchers alongside legacy Jest Native matchers by chang
// import '@testing-library/jest-native/extend-expect';

// With this:
import '@testing-library/react-native/extend-expect';
import '@testing-library/jest-native/legacy-extend-expect';
```

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion website/rspress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
},
multiVersion: {
default: '12.x',
versions: ['12.x', '13.x'],
versions: ['12.x', '13.x-alpha'],
},
route: {
cleanUrls: true,
Expand Down
Loading