From 7ae2c10aee291a18a228e5b3dda320fddfeeb559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Jastrze=CC=A8bski?= Date: Wed, 22 Jan 2025 16:09:57 +0100 Subject: [PATCH] docs: tweaks --- website/docs/12.x/docs/migration/v13.mdx | 72 -------------------- website/docs/13.x/docs/migration/v13.mdx | 2 +- website/docs/13.x/docs/start/intro.md | 6 -- website/docs/13.x/docs/start/quick-start.mdx | 10 +-- 4 files changed, 3 insertions(+), 87 deletions(-) delete mode 100644 website/docs/12.x/docs/migration/v13.mdx diff --git a/website/docs/12.x/docs/migration/v13.mdx b/website/docs/12.x/docs/migration/v13.mdx deleted file mode 100644 index ba3fbf227..000000000 --- a/website/docs/12.x/docs/migration/v13.mdx +++ /dev/null @@ -1,72 +0,0 @@ -# Migration to 13.0 - -Migration to React Native Testing Library version 13 from version 12.x. - -# Breaking changes - -## Supported React and React Native versions - -This version supports only React 19 and corresponding React Native versions. If you use React 18 or 19, please use latest of v12 versions. - -[Note: at the moment there is no React Native for React 19, and React 19 is still in beta, so we use React 18.3 for the time being]. - -## Removed deprecated \*ByAccessibilityState queries - -This deprecated query has been removed as is typically too general to give meaningful results. Use one of the following options: - -- [`*ByRole`](#by-role) query with relevant state options: `disabled`, `selected`, `checked`, `expanded` and `busy` -- use built-in Jest matchers to check the state of element found using some other query: - - enabled state: [`toBeEnabled()` / `toBeDisabled()`](docs/api/jest-matchers#tobeenabled) - - checked state: [`toBeChecked()` / `toBePartiallyChecked()`](docs/api/jest-matchers#tobechecked) - - selected state: [`toBeSelected()`](docs/api/jest-matchers#tobeselected) - - expanded state: [`toBeExpanded()` / `toBeCollapsed()`](docs/api/jest-matchers#tobeexpanded) - - busy state: [`toBeBusy()`](docs/api/jest-matchers#tobebusy) - -```ts -// Replace this -const view = screen.getByAccessibilityState({ disabled: true }); - -// with this (getByRole query) -const view = screen.getByRole('', { disabled: true }); - -// or this (Jest matcher) -const view = screen.getBy*(...); // Find the element using any query: *ByRole, *ByText, *ByTestId -expect(view).toBeDisabled(); // Assert its accessibility state -``` - -## Removed deprecated \*ByAccessibilityValue queries - -This deprecated query has been removed as is typically too general to give meaningful results. Use one of the following options: - -- [`toHaveAccessibilityValue()`](docs/api/jest-matchers#tohaveaccessibilityvalue) Jest matcher to check the state of element found using some other query -- [`*ByRole`](#by-role) query with `value` option - -```ts -// Replace this -const view = screen.getByAccessibilityValue({ now: 50, min: 0, max: 50 }); - -// with this (getByRole query) -const view = screen.getByRole('', { value: { now: 50, min: 0, max: 50 } }); - -// or this (Jest matcher) -const view = screen.getBy*(...); // Find the element using any query: *ByRole, *ByText, *ByTestId -expect(view).toHaveAccessibilityValue({ now: 50, min: 0, max: 50 }); // Assert its accessibility value -``` - -## Removed deprecated `debug(message)` variant - -The `debug(message)` variant has been removed. Use `debug({ message })` instead. - -## Removed `debug.shallow` - -For a time being we didn't support shallow rendering. Now we are removing the last remains of it: `debug.shallow()`. If you are interested in shallow rendering see [here](docs/migration/previous/v2#removed-global-shallow-function). - -# Other changes - -## Updated `flushMicroTasks` internal method - -This should not break any tests. - -## Full Changelog - -https://github.com/callstack/react-native-testing-library/compare/v12.5.2...v13.0.0 diff --git a/website/docs/13.x/docs/migration/v13.mdx b/website/docs/13.x/docs/migration/v13.mdx index ad73e551c..cb7c99b7d 100644 --- a/website/docs/13.x/docs/migration/v13.mdx +++ b/website/docs/13.x/docs/migration/v13.mdx @@ -119,4 +119,4 @@ This change should not break any tests. ## Full Changelog -https://github.com/callstack/react-native-testing-library/compare/v12.8.1...v13.0.0-beta.0 +https://github.com/callstack/react-native-testing-library/compare/v12.8.1...v13.0.0 diff --git a/website/docs/13.x/docs/start/intro.md b/website/docs/13.x/docs/start/intro.md index ef9c62b06..9da2bc174 100644 --- a/website/docs/13.x/docs/start/intro.md +++ b/website/docs/13.x/docs/start/intro.md @@ -1,11 +1,5 @@ # Introduction -:::warning - -This guide is for version 13.x of React Native Testing Library which is currently in beta! - -::: - ## The problem You want to write maintainable tests for your React Native components. As a part of this goal, you want your tests to avoid including implementation details of your components and focus on making your tests give you the confidence they are intended. As part of this, you want your tests to be maintainable in the long run so refactors of your components (changes to implementation but not functionality) don't break your tests and slow you and your team down. diff --git a/website/docs/13.x/docs/start/quick-start.mdx b/website/docs/13.x/docs/start/quick-start.mdx index 9e2392493..8a813a9ae 100644 --- a/website/docs/13.x/docs/start/quick-start.mdx +++ b/website/docs/13.x/docs/start/quick-start.mdx @@ -2,20 +2,14 @@ import { PackageManagerTabs } from 'rspress/theme'; # Quick Start -:::warning - -This guide is for version 13.x of React Native Testing Library which is currently in beta! - -::: - ## Installation Open a Terminal in your project's folder and run: