Skip to content
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

fix: native clipboard version bump #29119

Merged
merged 3 commits into from
Oct 11, 2023
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
12 changes: 6 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,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 @@ -817,7 +817,7 @@ PODS:
- RNScreens (3.21.0):
- React-Core
- React-RCTImage
- RNSVG (13.13.0):
- RNSVG (13.14.0):
- React-Core
- SDWebImage (5.11.1):
- SDWebImage/Core (= 5.11.1)
Expand Down Expand Up @@ -927,7 +927,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 @@ -1135,7 +1135,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 @@ -1287,7 +1287,7 @@ SPEC CHECKSUMS:
ReactCommon: 4b2bdcb50a3543e1c2b2849ad44533686610826d
RNAppleAuthentication: 0571c08da8c327ae2afc0261b48b4a515b0286a6
RNCAsyncStorage: 8616bd5a58af409453ea4e1b246521bb76578d60
RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495
RNCClipboard: d77213bfa269013bf4b857b7a9ca37ee062d8ef1
RNCPicker: 0b65be85fe7954fbb2062ef079e3d1cde252d888
RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140
RNDeviceInfo: 4701f0bf2a06b34654745053db0ce4cb0c53ada7
Expand All @@ -1306,7 +1306,7 @@ SPEC CHECKSUMS:
RNReactNativeHapticFeedback: 1e3efeca9628ff9876ee7cdd9edec1b336913f8c
RNReanimated: ab2e96c6d5591c3dfbb38a464f54c8d17fb34a87
RNScreens: d037903436160a4b039d32606668350d2a808806
RNSVG: ed492aaf3af9ca01bc945f7a149d76d62e73ec82
RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
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
Loading