Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: callstack/react-native-testing-library
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v13.0.1
Choose a base ref
...
head repository: callstack/react-native-testing-library
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v13.1.0
Choose a head ref
  • 11 commits
  • 162 files changed
  • 1 contributor

Commits on Jan 22, 2025

  1. React Native 0.77 Support (stable) (#1722)

    mdjastrzebski authored Jan 22, 2025
    Copy the full SHA
    3182936 View commit details
  2. docs: tweaks

    mdjastrzebski committed Jan 22, 2025
    Copy the full SHA
    7ae2c10 View commit details
  3. chore: cleanup legacy extend-expect from code and docs (#1739)

    mdjastrzebski authored Jan 22, 2025
    Copy the full SHA
    17ccd9e View commit details

Commits on Jan 29, 2025

  1. chore: reformat imports (#1742)

    mdjastrzebski authored Jan 29, 2025
    Copy the full SHA
    315afca View commit details

Commits on Feb 5, 2025

  1. feat: testOnly events (#1741)

    mdjastrzebski authored Feb 5, 2025
    Copy the full SHA
    c47220b View commit details
  2. refactor: cleanup website ci jobs (#1745)

    mdjastrzebski authored Feb 5, 2025
    Copy the full SHA
    0a0e50c View commit details

Commits on Feb 18, 2025

  1. React Native 0.78 Support (RC 5) (#1723)

    mdjastrzebski authored Feb 18, 2025
    Copy the full SHA
    16f9311 View commit details
  2. chore: fix tests (#1747)

    mdjastrzebski authored Feb 18, 2025
    Copy the full SHA
    1b90704 View commit details

Commits on Feb 20, 2025

  1. chore: RN 0.78.0 stable (#1748)

    mdjastrzebski authored Feb 20, 2025
    Copy the full SHA
    a9c056b View commit details

Commits on Feb 25, 2025

  1. fix: RN Gesture Handler Pressable support (#1746)

    mdjastrzebski authored Feb 25, 2025
    Copy the full SHA
    bd78a26 View commit details

Commits on Feb 27, 2025

  1. chore: release v13.1.0

    mdjastrzebski committed Feb 27, 2025
    Copy the full SHA
    9660127 View commit details
Showing with 1,204 additions and 9,492 deletions.
  1. +9 −17 .github/workflows/ci.yml
  2. +22 −2 .github/workflows/{deploy-website.yml → website.yml}
  3. +1 −1 eslint.config.mjs
  4. +2 −2 examples/basic/components/__tests__/AnimatedView.test.tsx
  5. +0 −8 examples/react-navigation/.gitignore
  6. +0 −16 examples/react-navigation/README.md
  7. +0 −4 examples/react-navigation/babel.config.js
  8. +0 −11 examples/react-navigation/jest-setup.js
  9. +0 −10 examples/react-navigation/jest.config.js
  10. +0 −30 examples/react-navigation/package.json
  11. +0 −21 examples/react-navigation/src/App.js
  12. +0 −15 examples/react-navigation/src/DrawerNavigator.js
  13. +0 −30 examples/react-navigation/src/DrawerNavigator.test.js
  14. +0 −15 examples/react-navigation/src/NativeStackNavigator.js
  15. +0 −26 examples/react-navigation/src/NativeStackNavigator.test.js
  16. +0 −15 examples/react-navigation/src/StackNavigator.js
  17. +0 −26 examples/react-navigation/src/StackNavigator.test.js
  18. +0 −15 examples/react-navigation/src/TabNavigator.js
  19. +0 −17 examples/react-navigation/src/TabNavigator.test.js
  20. +0 −39 examples/react-navigation/src/screens/DetailsScreen.js
  21. +0 −23 examples/react-navigation/src/screens/DetailsScreen.test.js
  22. +0 −26 examples/react-navigation/src/screens/DrawerHomeScreen.js
  23. +0 −48 examples/react-navigation/src/screens/HomeScreen.js
  24. +0 −20 examples/react-navigation/src/screens/SettingsScreen.js
  25. +0 −12 examples/react-navigation/src/test-utils.js
  26. +0 −8,028 examples/react-navigation/yarn.lock
  27. +0 −1 jest-setup.ts
  28. +8 −7 package.json
  29. +2 −1 src/__tests__/act.test.tsx
  30. +1 −0 src/__tests__/auto-cleanup.test.tsx
  31. +1 −0 src/__tests__/cleanup.test.tsx
  32. +59 −0 src/__tests__/event-handler.test.tsx
  33. +1 −0 src/__tests__/fire-event-textInput.test.tsx
  34. +1 −0 src/__tests__/fire-event.test.tsx
  35. +1 −0 src/__tests__/host-component-names.test.tsx
  36. +1 −0 src/__tests__/host-text-nesting.test.tsx
  37. +1 −0 src/__tests__/questionsBoard.test.tsx
  38. +5 −4 src/__tests__/react-native-animated.test.tsx
  39. +1 −0 src/__tests__/react-native-api.test.tsx
  40. +61 −0 src/__tests__/react-native-gesture-handler.test.tsx
  41. +1 −0 src/__tests__/render-debug.test.tsx
  42. +1 −0 src/__tests__/render-hook.test.tsx
  43. +1 −0 src/__tests__/render-string-validation.test.tsx
  44. +1 −0 src/__tests__/render.test.tsx
  45. +1 −0 src/__tests__/screen.test.tsx
  46. +1 −0 src/__tests__/wait-for-element-to-be-removed.test.tsx
  47. +1 −0 src/__tests__/wait-for.test.tsx
  48. +1 −0 src/__tests__/within.test.tsx
  49. +39 −0 src/event-handler.ts
  50. +3 −18 src/fire-event.ts
  51. +1 −0 src/helpers/__tests__/accessiblity.test.tsx
  52. +1 −0 src/helpers/__tests__/component-tree.test.tsx
  53. +1 −0 src/helpers/__tests__/format-element.test.tsx
  54. +1 −0 src/helpers/__tests__/include-hidden-elements.test.tsx
  55. +2 −1 src/helpers/__tests__/text-content.test.tsx
  56. +1 −0 src/helpers/__tests__/text-input.test.tsx
  57. +1 −0 src/helpers/accessibility.ts
  58. +1 −0 src/helpers/component-tree.ts
  59. +1 −0 src/helpers/debug.ts
  60. +1 −0 src/helpers/find-all.ts
  61. +1 −0 src/helpers/format-element.ts
  62. +1 −0 src/helpers/host-component-names.ts
  63. +1 −0 src/helpers/map-props.ts
  64. +1 −0 src/helpers/matchers/match-accessibility-state.ts
  65. +1 −0 src/helpers/matchers/match-accessibility-value.ts
  66. +1 −0 src/helpers/matchers/match-label-text.ts
  67. +1 −0 src/helpers/matchers/match-text-content.ts
  68. +1 −0 src/helpers/pointer-events.ts
  69. +1 −0 src/helpers/text-input.ts
  70. +1 −0 src/index.ts
  71. +1 −0 src/matchers/__tests__/to-be-busy.test.tsx
  72. +1 −0 src/matchers/__tests__/to-be-checked.test.tsx
  73. +1 −3 src/matchers/__tests__/to-be-disabled.test.tsx
  74. +1 −0 src/matchers/__tests__/to-be-empty-element.test.tsx
  75. +1 −0 src/matchers/__tests__/to-be-expanded.test.tsx
  76. +1 −0 src/matchers/__tests__/to-be-on-the-screen.test.tsx
  77. +1 −0 src/matchers/__tests__/to-be-partially-checked.test.tsx
  78. +1 −0 src/matchers/__tests__/to-be-selected.test.tsx
  79. +1 −0 src/matchers/__tests__/to-be-visible.test.tsx
  80. +1 −0 src/matchers/__tests__/to-contain-element.test.tsx
  81. +1 −0 src/matchers/__tests__/to-have-accessibility-value.test.tsx
  82. +1 −0 src/matchers/__tests__/to-have-accessible-name.test.tsx
  83. +1 −0 src/matchers/__tests__/to-have-display-value.test.tsx
  84. +1 −0 src/matchers/__tests__/to-have-prop.test.tsx
  85. +1 −0 src/matchers/__tests__/to-have-style.test.tsx
  86. +1 −0 src/matchers/__tests__/to-have-text-content.test.tsx
  87. +1 −0 src/matchers/__tests__/utils.test.tsx
  88. +1 −0 src/matchers/to-be-busy.ts
  89. +1 −0 src/matchers/to-be-checked.ts
  90. +1 −0 src/matchers/to-be-disabled.ts
  91. +1 −0 src/matchers/to-be-empty-element.ts
  92. +1 −0 src/matchers/to-be-expanded.ts
  93. +1 −0 src/matchers/to-be-on-the-screen.ts
  94. +1 −0 src/matchers/to-be-partially-checked.ts
  95. +1 −0 src/matchers/to-be-selected.ts
  96. +1 −0 src/matchers/to-be-visible.ts
  97. +1 −0 src/matchers/to-contain-element.ts
  98. +1 −0 src/matchers/to-have-accessibility-value.ts
  99. +1 −0 src/matchers/to-have-accessible-name.ts
  100. +1 −0 src/matchers/to-have-display-value.ts
  101. +1 −0 src/matchers/to-have-prop.ts
  102. +1 −0 src/matchers/to-have-style.ts
  103. +1 −0 src/matchers/to-have-text-content.ts
  104. +1 −0 src/matchers/types.ts
  105. +1 −0 src/matchers/utils.ts
  106. +1 −0 src/native-state.ts
  107. +1 −1 src/queries/__tests__/display-value.test.tsx
  108. +1 −0 src/queries/__tests__/find-by.test.tsx
  109. +1 −0 src/queries/__tests__/hint-text.test.tsx
  110. +1 −0 src/queries/__tests__/label-text.test.tsx
  111. +1 −0 src/queries/__tests__/make-queries.test.tsx
  112. +1 −0 src/queries/__tests__/placeholder-text.test.tsx
  113. +1 −0 src/queries/__tests__/role-value.test.tsx
  114. +1 −0 src/queries/__tests__/role.test.tsx
  115. +1 −0 src/queries/__tests__/test-id.test.tsx
  116. +1 −0 src/queries/__tests__/text.test.tsx
  117. +1 −0 src/queries/display-value.ts
  118. +1 −0 src/queries/hint-text.ts
  119. +1 −0 src/queries/label-text.ts
  120. +1 −0 src/queries/make-queries.ts
  121. +1 −0 src/queries/placeholder-text.ts
  122. +1 −0 src/queries/role.ts
  123. +1 −0 src/queries/test-id.ts
  124. +1 −0 src/queries/text.ts
  125. +1 −0 src/queries/unsafe-props.ts
  126. +1 −0 src/queries/unsafe-type.ts
  127. +1 −0 src/render-act.ts
  128. +1 −0 src/render-hook.tsx
  129. +2 −1 src/render.tsx
  130. +1 −0 src/screen.ts
  131. +1 −0 src/user-event/__tests__/clear.test.tsx
  132. +1 −0 src/user-event/__tests__/paste.test.tsx
  133. +1 −0 src/user-event/clear.ts
  134. +1 −0 src/user-event/index.ts
  135. +1 −0 src/user-event/paste.ts
  136. +1 −0 src/user-event/press/__tests__/longPress.real-timers.test.tsx
  137. +34 −1 src/user-event/press/__tests__/longPress.test.tsx
  138. +9 −3 src/user-event/press/__tests__/press.real-timers.test.tsx
  139. +15 −0 src/user-event/press/__tests__/press.test.tsx
  140. +62 −59 src/user-event/press/press.ts
  141. +1 −0 src/user-event/scroll/__tests__/scroll-to-flat-list.test.tsx
  142. +1 −0 src/user-event/scroll/__tests__/scroll-to.test.tsx
  143. +1 −0 src/user-event/scroll/scroll-to.ts
  144. +1 −0 src/user-event/setup/setup.ts
  145. +1 −0 src/user-event/type/__tests__/type-managed.test.tsx
  146. +1 −0 src/user-event/type/__tests__/type.test.tsx
  147. +1 −0 src/user-event/type/type.ts
  148. +2 −1 src/user-event/utils/__tests__/dispatch-event.test.tsx
  149. +2 −14 src/user-event/utils/dispatch-event.ts
  150. +1 −0 src/within.ts
  151. +1 −3 website/docs/12.x/docs/advanced/understanding-act.mdx
  152. +3 −3 website/docs/12.x/docs/api.md
  153. +0 −72 website/docs/12.x/docs/migration/v13.mdx
  154. +1 −1 website/docs/13.x/docs/advanced/_meta.json
  155. +39 −0 website/docs/13.x/docs/advanced/third-party-integration.mdx
  156. +3 −3 website/docs/13.x/docs/api.md
  157. +1 −14 website/docs/13.x/docs/api/jest-matchers.mdx
  158. +1 −1 website/docs/13.x/docs/migration/jest-matchers.mdx
  159. +1 −1 website/docs/13.x/docs/migration/v13.mdx
  160. +0 −6 website/docs/13.x/docs/start/intro.md
  161. +2 −8 website/docs/13.x/docs/start/quick-start.mdx
  162. +705 −788 yarn.lock
26 changes: 9 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ jobs:
test:
needs: [install-cache-deps]
runs-on: ubuntu-latest
name: Test (concurrent)
name: Test
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -67,29 +67,21 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test-legacy:
test-react-18:
needs: [install-cache-deps]
runs-on: ubuntu-latest
name: Test (legacy)
name: Test React 18
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js and deps
uses: ./.github/actions/setup-deps

- name: Test in legacy mode
run: CONCURRENT_MODE=0 yarn test:ci
- name: Switch to React 18
run: |
yarn remove react react-test-renderer react-native @react-native/babel-preset
yarn add -D react@18.3.1 react-test-renderer@18.3.1 react-native@0.77.0 @react-native/babel-preset@0.77.0
test-website:
runs-on: ubuntu-latest
name: Test Website
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js and website deps
uses: ./.github/actions/setup-website-deps

- name: Build website
run: yarn --cwd website build
- name: Test
run: yarn test:ci
Original file line number Diff line number Diff line change
@@ -4,10 +4,31 @@ on:
push:
branches: [main]
paths: ['website/**']
pull_request:
branches: ['**']
paths: ['website/**']

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'main')}}

jobs:
test:
runs-on: ubuntu-latest
name: Test Website
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js and website deps
uses: ./.github/actions/setup-website-deps

- name: Build website
run: yarn --cwd website build

deploy:
name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -25,12 +46,11 @@ jobs:
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./website/build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
user_email: 41898282+github-actions[bot]@users.noreply.github.com
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ export default [
'simple-import-sort/imports': [
'error',
{
groups: [['^\\u0000', '^react', '^@?\\w', '^', '^\\.']],
groups: [['^\\u0000', '^react', '^@?\\w', '^'], ['^\\.']],
},
],
},
4 changes: 2 additions & 2 deletions examples/basic/components/__tests__/AnimatedView.test.tsx
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ describe('AnimatedView', () => {
);
expect(screen.root).toHaveStyle({ opacity: 0 });

await act(() => jest.advanceTimersByTime(250));
act(() => jest.advanceTimersByTime(250));
expect(screen.root).toHaveStyle({ opacity: 1 });
});

@@ -32,7 +32,7 @@ describe('AnimatedView', () => {
);
expect(screen.root).toHaveStyle({ opacity: 0 });

await act(() => jest.advanceTimersByTime(250));
act(() => jest.advanceTimersByTime(250));
expect(screen.root).toHaveStyle({ opacity: 1 });
});
});
8 changes: 0 additions & 8 deletions examples/react-navigation/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions examples/react-navigation/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions examples/react-navigation/babel.config.js

This file was deleted.

11 changes: 0 additions & 11 deletions examples/react-navigation/jest-setup.js

This file was deleted.

10 changes: 0 additions & 10 deletions examples/react-navigation/jest.config.js

This file was deleted.

30 changes: 0 additions & 30 deletions examples/react-navigation/package.json

This file was deleted.

21 changes: 0 additions & 21 deletions examples/react-navigation/src/App.js

This file was deleted.

15 changes: 0 additions & 15 deletions examples/react-navigation/src/DrawerNavigator.js

This file was deleted.

30 changes: 0 additions & 30 deletions examples/react-navigation/src/DrawerNavigator.test.js

This file was deleted.

15 changes: 0 additions & 15 deletions examples/react-navigation/src/NativeStackNavigator.js

This file was deleted.

26 changes: 0 additions & 26 deletions examples/react-navigation/src/NativeStackNavigator.test.js

This file was deleted.

15 changes: 0 additions & 15 deletions examples/react-navigation/src/StackNavigator.js

This file was deleted.

26 changes: 0 additions & 26 deletions examples/react-navigation/src/StackNavigator.test.js

This file was deleted.

15 changes: 0 additions & 15 deletions examples/react-navigation/src/TabNavigator.js

This file was deleted.

17 changes: 0 additions & 17 deletions examples/react-navigation/src/TabNavigator.test.js

This file was deleted.

Loading