Skip to content

Commit

Permalink
chore: bump RNTL version and migrate matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienIzz committed Feb 2, 2024
1 parent 95c454a commit 2e6573a
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 57 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@react-native-community/eslint-config": "^3.2.0",
"@testing-library/react-native": "^12.4.3",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@typescript-eslint/eslint-plugin": "^5.60.1",
Expand Down
1 change: 0 additions & 1 deletion packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"license": "MIT",
"devDependencies": {
"@testing-library/jest-native": "^5.4.3",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/react-native": "^12.3.1",
"@types/jest": "^29.5.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const TestScreen = ({ onDirectionHandledWithoutMovement = () => undefined }) =>

export const expectButtonToHaveFocus = (component: RenderResult, text: string) => {
const element = component.getByRole('button', { name: text });
expect(element).toHaveAccessibilityState({ selected: true });
expect(element).toBeSelected();
};

describe('Spatial Navigation Movement', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import testRemoteControlManager from '../tests/helpers/testRemoteControlManager'

export const expectButtonToHaveFocus = (component: RenderResult, text: string) => {
const element = component.getByRole('button', { name: text });
expect(element).toHaveAccessibilityState({ selected: true });
expect(element).toBeSelected();
};

describe('SpatialNavigationVirtualizedGrid', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import testRemoteControlManager from '../tests/helpers/testRemoteControlManager'

export const expectButtonToHaveFocus = (component: RenderResult, text: string) => {
const element = component.getByRole('button', { name: text });
expect(element).toHaveAccessibilityState({ selected: true });
expect(element).toBeSelected();
};

describe('SpatialNavigationVirtualizedList', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/testing/jest-setupAfterEnv.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '@testing-library/jest-native/extend-expect';
import '@testing-library/react-native/extend-expect';

import { TEST_DEFAULT_DATE, TEST_DEFAULT_MATH_RANDOM } from './constants';

Expand Down
106 changes: 54 additions & 52 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4835,23 +4835,6 @@ __metadata:
languageName: node
linkType: hard

"@testing-library/jest-native@npm:^5.4.3":
version: 5.4.3
resolution: "@testing-library/jest-native@npm:5.4.3"
dependencies:
chalk: ^4.1.2
jest-diff: ^29.0.1
jest-matcher-utils: ^29.0.1
pretty-format: ^29.0.3
redent: ^3.0.0
peerDependencies:
react: ">=16.0.0"
react-native: ">=0.59"
react-test-renderer: ">=16.0.0"
checksum: 2a4ebfeff09523860771cfddac6fcc3faa2f855dc63255b9efc016e727132320f16f935cec9717d6d79cfa6715fce6ded877215c8ec85d236a5c3136a65b1020
languageName: node
linkType: hard

"@testing-library/react-hooks@npm:^8.0.1":
version: 8.0.1
resolution: "@testing-library/react-hooks@npm:8.0.1"
Expand Down Expand Up @@ -4893,6 +4876,25 @@ __metadata:
languageName: node
linkType: hard

"@testing-library/react-native@npm:^12.4.3":
version: 12.4.3
resolution: "@testing-library/react-native@npm:12.4.3"
dependencies:
jest-matcher-utils: ^29.7.0
pretty-format: ^29.7.0
redent: ^3.0.0
peerDependencies:
jest: ">=28.0.0"
react: ">=16.8.0"
react-native: ">=0.59"
react-test-renderer: ">=16.8.0"
peerDependenciesMeta:
jest:
optional: true
checksum: bd1c06b200063ffad26245cbc61b7256b5bfcc2c69a32f7e6dc9ff1bf44c3743117d5010b8dbc8f9a1b660c3ee22ccf9ecc320c03db52f9ec75ba7e52c1d8ba3
languageName: node
linkType: hard

"@tootallnate/once@npm:2":
version: 2.0.0
resolution: "@tootallnate/once@npm:2.0.0"
Expand Down Expand Up @@ -11149,18 +11151,6 @@ __metadata:
languageName: node
linkType: hard

"jest-diff@npm:^29.0.1, jest-diff@npm:^29.7.0":
version: 29.7.0
resolution: "jest-diff@npm:29.7.0"
dependencies:
chalk: ^4.0.0
diff-sequences: ^29.6.3
jest-get-type: ^29.6.3
pretty-format: ^29.7.0
checksum: 08e24a9dd43bfba1ef07a6374e5af138f53137b79ec3d5cc71a2303515335898888fa5409959172e1e05de966c9e714368d15e8994b0af7441f0721ee8e1bb77
languageName: node
linkType: hard

"jest-diff@npm:^29.6.0":
version: 29.6.0
resolution: "jest-diff@npm:29.6.0"
Expand All @@ -11185,6 +11175,18 @@ __metadata:
languageName: node
linkType: hard

"jest-diff@npm:^29.7.0":
version: 29.7.0
resolution: "jest-diff@npm:29.7.0"
dependencies:
chalk: ^4.0.0
diff-sequences: ^29.6.3
jest-get-type: ^29.6.3
pretty-format: ^29.7.0
checksum: 08e24a9dd43bfba1ef07a6374e5af138f53137b79ec3d5cc71a2303515335898888fa5409959172e1e05de966c9e714368d15e8994b0af7441f0721ee8e1bb77
languageName: node
linkType: hard

"jest-docblock@npm:^29.4.3":
version: 29.4.3
resolution: "jest-docblock@npm:29.4.3"
Expand Down Expand Up @@ -11303,18 +11305,6 @@ __metadata:
languageName: node
linkType: hard

"jest-matcher-utils@npm:^29.0.1, jest-matcher-utils@npm:^29.7.0":
version: 29.7.0
resolution: "jest-matcher-utils@npm:29.7.0"
dependencies:
chalk: ^4.0.0
jest-diff: ^29.7.0
jest-get-type: ^29.6.3
pretty-format: ^29.7.0
checksum: d7259e5f995d915e8a37a8fd494cb7d6af24cd2a287b200f831717ba0d015190375f9f5dc35393b8ba2aae9b2ebd60984635269c7f8cff7d85b077543b7744cd
languageName: node
linkType: hard

"jest-matcher-utils@npm:^29.6.0":
version: 29.6.0
resolution: "jest-matcher-utils@npm:29.6.0"
Expand All @@ -11339,6 +11329,18 @@ __metadata:
languageName: node
linkType: hard

"jest-matcher-utils@npm:^29.7.0":
version: 29.7.0
resolution: "jest-matcher-utils@npm:29.7.0"
dependencies:
chalk: ^4.0.0
jest-diff: ^29.7.0
jest-get-type: ^29.6.3
pretty-format: ^29.7.0
checksum: d7259e5f995d915e8a37a8fd494cb7d6af24cd2a287b200f831717ba0d015190375f9f5dc35393b8ba2aae9b2ebd60984635269c7f8cff7d85b077543b7744cd
languageName: node
linkType: hard

"jest-message-util@npm:^29.6.0":
version: 29.6.0
resolution: "jest-message-util@npm:29.6.0"
Expand Down Expand Up @@ -14073,25 +14075,25 @@ __metadata:
languageName: node
linkType: hard

"pretty-format@npm:^29.0.3, pretty-format@npm:^29.7.0":
version: 29.7.0
resolution: "pretty-format@npm:29.7.0"
"pretty-format@npm:^29.6.2":
version: 29.6.2
resolution: "pretty-format@npm:29.6.2"
dependencies:
"@jest/schemas": ^29.6.3
"@jest/schemas": ^29.6.0
ansi-styles: ^5.0.0
react-is: ^18.0.0
checksum: 032c1602383e71e9c0c02a01bbd25d6759d60e9c7cf21937dde8357aa753da348fcec5def5d1002c9678a8524d5fe099ad98861286550ef44de8808cc61e43b6
checksum: a0f972a44f959023c0df9cdfe9eed7540264d7f7ddf74667db8a5294444d5aa153fd47d20327df10ae86964e2ceec10e46ea06b1a5c9c12e02348b78c952c9fc
languageName: node
linkType: hard

"pretty-format@npm:^29.6.2":
version: 29.6.2
resolution: "pretty-format@npm:29.6.2"
"pretty-format@npm:^29.7.0":
version: 29.7.0
resolution: "pretty-format@npm:29.7.0"
dependencies:
"@jest/schemas": ^29.6.0
"@jest/schemas": ^29.6.3
ansi-styles: ^5.0.0
react-is: ^18.0.0
checksum: a0f972a44f959023c0df9cdfe9eed7540264d7f7ddf74667db8a5294444d5aa153fd47d20327df10ae86964e2ceec10e46ea06b1a5c9c12e02348b78c952c9fc
checksum: 032c1602383e71e9c0c02a01bbd25d6759d60e9c7cf21937dde8357aa753da348fcec5def5d1002c9678a8524d5fe099ad98861286550ef44de8808cc61e43b6
languageName: node
linkType: hard

Expand Down Expand Up @@ -14525,6 +14527,7 @@ __metadata:
"@react-native-community/eslint-config": ^3.2.0
"@react-native-tvos/config-tv": ^0.0.4
"@react-navigation/bottom-tabs": ^6.5.11
"@testing-library/react-native": ^12.4.3
"@types/react": ^18.2.14
"@types/react-dom": ^18.2.6
"@typescript-eslint/eslint-plugin": ^5.60.1
Expand Down Expand Up @@ -14562,7 +14565,6 @@ __metadata:
resolution: "react-tv-space-navigation@workspace:packages/lib"
dependencies:
"@bam.tech/lrud": ^8.0.1
"@testing-library/jest-native": ^5.4.3
"@testing-library/react-hooks": ^8.0.1
"@testing-library/react-native": ^12.3.1
"@types/jest": ^29.5.3
Expand Down

0 comments on commit 2e6573a

Please sign in to comment.