Skip to content

Commit

Permalink
Merge pull request #29119 from b4s36t4/fix/clipboard-text
Browse files Browse the repository at this point in the history
fix: native clipboard version bump
  • Loading branch information
tgolen authored Oct 11, 2023
2 parents 9e6af2b + 9f4a8f5 commit e825aa7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 26 deletions.
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ PODS:
- React-Core
- RNCAsyncStorage (1.17.11):
- React-Core
- RNCClipboard (1.5.1):
- RNCClipboard (1.12.1):
- React-Core
- RNCPicker (2.4.4):
- React-Core
Expand Down Expand Up @@ -915,7 +915,7 @@ DEPENDENCIES:
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "RNAppleAuthentication (from `../node_modules/@invertase/react-native-apple-authentication`)"
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
- "RNCClipboard (from `../node_modules/@react-native-community/clipboard`)"
- "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)"
- "RNCPicker (from `../node_modules/@react-native-picker/picker`)"
- "RNDateTimePicker (from `../node_modules/@react-native-community/datetimepicker`)"
- RNDeviceInfo (from `../node_modules/react-native-device-info`)
Expand Down Expand Up @@ -1115,7 +1115,7 @@ EXTERNAL SOURCES:
RNCAsyncStorage:
:path: "../node_modules/@react-native-async-storage/async-storage"
RNCClipboard:
:path: "../node_modules/@react-native-community/clipboard"
:path: "../node_modules/@react-native-clipboard/clipboard"
RNCPicker:
:path: "../node_modules/@react-native-picker/picker"
RNDateTimePicker:
Expand Down Expand Up @@ -1263,7 +1263,7 @@ SPEC CHECKSUMS:
ReactCommon: 4b2bdcb50a3543e1c2b2849ad44533686610826d
RNAppleAuthentication: 0571c08da8c327ae2afc0261b48b4a515b0286a6
RNCAsyncStorage: 8616bd5a58af409453ea4e1b246521bb76578d60
RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495
RNCClipboard: d77213bfa269013bf4b857b7a9ca37ee062d8ef1
RNCPicker: 0b65be85fe7954fbb2062ef079e3d1cde252d888
RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140
RNDeviceInfo: 4701f0bf2a06b34654745053db0ce4cb0c53ada7
Expand Down
5 changes: 5 additions & 0 deletions jest/setup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'setimmediate';
import 'react-native-gesture-handler/jestSetup';
import * as reanimatedJestUtils from 'react-native-reanimated/src/reanimated2/jestUtils';
import mockClipboard from '@react-native-clipboard/clipboard/jest/clipboard-mock';
import setupMockImages from './setupMockImages';

setupMockImages();
Expand All @@ -10,6 +11,10 @@ reanimatedJestUtils.setUpTests();
// https://reactnavigation.org/docs/testing/#mocking-native-modules
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');

// Clipboard requires mocking as NativeEmitter will be undefined with jest-runner.
// https://github.com/react-native-clipboard/clipboard#mocking-clipboard
jest.mock('@react-native-clipboard/clipboard', () => mockClipboard);

// Mock react-native-onyx storage layer because the SQLite storage layer doesn't work in jest.
// Mocking this file in __mocks__ does not work because jest doesn't support mocking files that are not directly used in the testing project,
// and we only want to mock the storage layer, not the whole Onyx module.
Expand Down
33 changes: 16 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@onfido/react-native-sdk": "7.4.0",
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-native-camera-roll/camera-roll": "5.4.0",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-clipboard/clipboard": "^1.12.1",
"@react-native-community/datetimepicker": "^3.5.2",
"@react-native-community/geolocation": "^3.0.6",
"@react-native-community/netinfo": "^9.3.10",
Expand Down
3 changes: 1 addition & 2 deletions src/libs/Clipboard/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// on Web/desktop this import will be replaced with `react-native-web`
import {Clipboard} from 'react-native-web';
import Clipboard from '@react-native-clipboard/clipboard';
import lodashGet from 'lodash/get';
import CONST from '../../CONST';
import * as Browser from '../Browser';
Expand Down
4 changes: 2 additions & 2 deletions src/libs/Clipboard/index.native.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Clipboard from '@react-native-community/clipboard';
import Clipboard from '@react-native-clipboard/clipboard';

/**
* Sets a string on the Clipboard object via @react-native-community/clipboard
* Sets a string on the Clipboard object via @react-native-clipboard/clipboard
*
* @param {String} text
*/
Expand Down

0 comments on commit e825aa7

Please sign in to comment.