diff --git a/ios/Podfile.lock b/ios/Podfile.lock index b4226a18fb71..6fcc30df6fc4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -478,6 +478,8 @@ PODS: - React-Core - react-native-pdf (6.6.2): - React-Core + - react-native-performance (4.0.0): + - React-Core - react-native-plaid-link-sdk (7.4.0): - Plaid (~> 2.5.1) - React-Core @@ -485,6 +487,10 @@ PODS: - React - react-native-progress-view (1.3.2): - React-Core + - react-native-quick-sqlite (5.1.0): + - React + - React-callinvoker + - React-Core - react-native-render-html (6.3.1): - React-Core - react-native-safe-area-context (4.4.1): @@ -561,7 +567,7 @@ PODS: - React-jsi (= 0.70.4-alpha.2) - React-logger (= 0.70.4-alpha.2) - React-perflogger (= 0.70.4-alpha.2) - - RNCAsyncStorage (1.17.10): + - RNCAsyncStorage (1.17.11): - React-Core - RNCClipboard (1.5.1): - React-Core @@ -700,9 +706,11 @@ DEPENDENCIES: - react-native-image-picker (from `../node_modules/react-native-image-picker`) - "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)" - react-native-pdf (from `../node_modules/react-native-pdf`) + - react-native-performance (from `../node_modules/react-native-performance`) - react-native-plaid-link-sdk (from `../node_modules/react-native-plaid-link-sdk`) - "react-native-progress-bar-android (from `../node_modules/@react-native-community/progress-bar-android`)" - "react-native-progress-view (from `../node_modules/@react-native-community/progress-view`)" + - react-native-quick-sqlite (from `../node_modules/react-native-quick-sqlite`) - react-native-render-html (from `../node_modules/react-native-render-html`) - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) - react-native-webview (from `../node_modules/react-native-webview`) @@ -845,12 +853,16 @@ EXTERNAL SOURCES: :path: "../node_modules/@react-native-community/netinfo" react-native-pdf: :path: "../node_modules/react-native-pdf" + react-native-performance: + :path: "../node_modules/react-native-performance" react-native-plaid-link-sdk: :path: "../node_modules/react-native-plaid-link-sdk" react-native-progress-bar-android: :path: "../node_modules/@react-native-community/progress-bar-android" react-native-progress-view: :path: "../node_modules/@react-native-community/progress-view" + react-native-quick-sqlite: + :path: "../node_modules/react-native-quick-sqlite" react-native-render-html: :path: "../node_modules/react-native-render-html" react-native-safe-area-context: @@ -983,9 +995,11 @@ SPEC CHECKSUMS: react-native-image-picker: bf34f3f516d139ed3e24c5f5a381a91819e349ea react-native-netinfo: 1a6035d3b9780221d407c277ebfb5722ace00658 react-native-pdf: 33c622cbdf776a649929e8b9d1ce2d313347c4fa + react-native-performance: 224bd53e6a835fda4353302cf891d088a0af7406 react-native-plaid-link-sdk: 77052f329310ff5a36ddda276793f40d27c02bc4 react-native-progress-bar-android: be43138ab7da30d51fc038bafa98e9ed594d0c40 react-native-progress-view: 4d3bbe6a099ba027b1fedb1548c2c87f74249b70 + react-native-quick-sqlite: a7bd4139fb07194ef8534d1cc14c1aec6daa4d84 react-native-render-html: 96c979fe7452a0a41559685d2f83b12b93edac8c react-native-safe-area-context: 99b24a0c5acd0d5dcac2b1a7f18c49ea317be99a react-native-webview: e771bc375f789ebfa02a26939a57dbc6fa897336 @@ -1001,7 +1015,7 @@ SPEC CHECKSUMS: React-RCTVibration: eb5fb0bb3d78e31dcaeae5f127c75a7caf4b6af9 React-runtimeexecutor: a8cee6fe3fb7994f07b735c7024a08a4fa5f8446 ReactCommon: 1ebf2df5c764ebb52048e7a1cf42c75a6246171a - RNCAsyncStorage: 0c357f3156fcb16c8589ede67cc036330b6698ca + RNCAsyncStorage: 8616bd5a58af409453ea4e1b246521bb76578d60 RNCClipboard: 41d8d918092ae8e676f18adada19104fa3e68495 RNCPicker: 0b65be85fe7954fbb2062ef079e3d1cde252d888 RNDateTimePicker: 7658208086d86d09e1627b5c34ba0cf237c60140 diff --git a/jest/setup.js b/jest/setup.js index 0120b00a869e..7578679ee111 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -9,6 +9,10 @@ reanimatedJestUtils.setUpTests(); // https://reactnavigation.org/docs/testing/#mocking-native-modules jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper'); +// We have to mock the SQLiteStorage provider because it uses the native module SQLiteStorage, which is not available 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 +jest.mock('react-native-onyx/lib/storage/providers/SQLiteStorage', () => require('react-native-onyx/lib/storage/providers/__mocks__/SQLiteStorage')); + // Turn off the console logs for timing events. They are not relevant for unit tests and create a lot of noise jest.spyOn(console, 'debug').mockImplementation((...params) => { if (params[0].indexOf('Timing:') === 0) { diff --git a/package-lock.json b/package-lock.json index 7b7942bb80ea..12d2bf52f917 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,12 +68,13 @@ "react-native-image-picker": "^4.10.2", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.29", + "react-native-onyx": "1.0.32", "react-native-pdf": "^6.6.2", - "react-native-performance": "^2.0.0", + "react-native-performance": "^4.0.0", "react-native-permissions": "^3.0.1", "react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#77cc9d42c474a693755941b10ee4c2d6f50e5346", "react-native-plaid-link-sdk": "^7.2.0", + "react-native-quick-sqlite": "^5.0.3", "react-native-reanimated": "3.0.0-rc.6", "react-native-render-html": "6.3.1", "react-native-safe-area-context": "4.4.1", @@ -4260,14 +4261,14 @@ "dev": true }, "node_modules/@react-native-async-storage/async-storage": { - "version": "1.17.10", - "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.17.10.tgz", - "integrity": "sha512-KrR021BmBLsA0TT1AAsfH16bHYy0MSbhdAeBAqpriak3GS1T2alFcdTUvn13p0ZW6FKRD6Bd3ryU2zhU/IYYJQ==", + "version": "1.17.11", + "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.17.11.tgz", + "integrity": "sha512-bzs45n5HNcDq6mxXnSsOHysZWn1SbbebNxldBXCQs8dSvF8Aor9KCdpm+TpnnGweK3R6diqsT8lFhX77VX0NFw==", "dependencies": { "merge-options": "^3.0.4" }, "peerDependencies": { - "react-native": "^0.0.0-0 || 0.60 - 0.70 || 1000.0.0" + "react-native": "^0.0.0-0 || 0.60 - 0.71 || 1000.0.0" } }, "node_modules/@react-native-community/cameraroll": { @@ -35466,21 +35467,26 @@ } }, "node_modules/react-native-onyx": { - "version": "1.0.29", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.29.tgz", - "integrity": "sha512-Zg7v6bimkRPqaAM5C/CqMswSObPGX+2BK2Gr7r4P1htSMjNlvn+fZ9gD4mwJBPgnoEUqMdFGLUshksHbE+GSMg==", + "version": "1.0.32", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.32.tgz", + "integrity": "sha512-mhmCrxYfNlLM8bpP2M5g1u90115VqbJ1Lt2PjyrQsJihHRTdc7yqbiWwWlEQ1KyAYVR79JCSesKelgkdRAZIag==", "dependencies": { "ascii-table": "0.0.9", "fast-equals": "^4.0.3", "lodash": "^4.17.21", "underscore": "^1.13.1" }, + "engines": { + "node": "16.15.1", + "npm": "8.11.0" + }, "peerDependencies": { - "@react-native-async-storage/async-storage": "^1.15.5", + "@react-native-async-storage/async-storage": "^1.17.11", "expensify-common": ">=1", "localforage": "^1.10.0", - "react": ">=17.0.2", - "react-native-performance": "^2.0.0" + "react": ">=18.1.0", + "react-native-performance": "^4.0.0", + "react-native-quick-sqlite": "^5.0.3" }, "peerDependenciesMeta": { "@react-native-async-storage/async-storage": { @@ -35491,6 +35497,9 @@ }, "react-native-performance": { "optional": true + }, + "react-native-quick-sqlite": { + "optional": true } } }, @@ -35504,9 +35513,9 @@ } }, "node_modules/react-native-performance": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/react-native-performance/-/react-native-performance-2.1.0.tgz", - "integrity": "sha512-Q3dFPN7whBCY7X8nvQe7TBw4F5g1PyB78KwyKDXpJENcDrBodlFtj9/c5T2ZkRwAPb+bxr39b+lq9FyT6WQWtg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/react-native-performance/-/react-native-performance-4.0.0.tgz", + "integrity": "sha512-GgRNl52ivoq8gNSzFlapIc8ywszGJtQsoUZxo4bvt+xGcUIYecp93oDt88x4te637qjeT+FabXTtau66EFbf7g==", "peerDependencies": { "react-native": "*" } @@ -35557,6 +35566,15 @@ "react-native": ">=0.61" } }, + "node_modules/react-native-quick-sqlite": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/react-native-quick-sqlite/-/react-native-quick-sqlite-5.1.0.tgz", + "integrity": "sha512-OAwMXVqK3sGA9Ez+uKLji6hbSJVg0+vW5rAsZJgnveEpIby9RK5Fq9bhoJ9Yxe8ERmAWMKkLYp4afXNyJGYBBQ==", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, "node_modules/react-native-reanimated": { "version": "3.0.0-rc.6", "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.0.0-rc.6.tgz", @@ -45788,9 +45806,9 @@ "dev": true }, "@react-native-async-storage/async-storage": { - "version": "1.17.10", - "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.17.10.tgz", - "integrity": "sha512-KrR021BmBLsA0TT1AAsfH16bHYy0MSbhdAeBAqpriak3GS1T2alFcdTUvn13p0ZW6FKRD6Bd3ryU2zhU/IYYJQ==", + "version": "1.17.11", + "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.17.11.tgz", + "integrity": "sha512-bzs45n5HNcDq6mxXnSsOHysZWn1SbbebNxldBXCQs8dSvF8Aor9KCdpm+TpnnGweK3R6diqsT8lFhX77VX0NFw==", "requires": { "merge-options": "^3.0.4" } @@ -69847,9 +69865,9 @@ } }, "react-native-onyx": { - "version": "1.0.29", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.29.tgz", - "integrity": "sha512-Zg7v6bimkRPqaAM5C/CqMswSObPGX+2BK2Gr7r4P1htSMjNlvn+fZ9gD4mwJBPgnoEUqMdFGLUshksHbE+GSMg==", + "version": "1.0.32", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.32.tgz", + "integrity": "sha512-mhmCrxYfNlLM8bpP2M5g1u90115VqbJ1Lt2PjyrQsJihHRTdc7yqbiWwWlEQ1KyAYVR79JCSesKelgkdRAZIag==", "requires": { "ascii-table": "0.0.9", "fast-equals": "^4.0.3", @@ -69867,9 +69885,9 @@ } }, "react-native-performance": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/react-native-performance/-/react-native-performance-2.1.0.tgz", - "integrity": "sha512-Q3dFPN7whBCY7X8nvQe7TBw4F5g1PyB78KwyKDXpJENcDrBodlFtj9/c5T2ZkRwAPb+bxr39b+lq9FyT6WQWtg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/react-native-performance/-/react-native-performance-4.0.0.tgz", + "integrity": "sha512-GgRNl52ivoq8gNSzFlapIc8ywszGJtQsoUZxo4bvt+xGcUIYecp93oDt88x4te637qjeT+FabXTtau66EFbf7g==", "requires": {} }, "react-native-performance-flipper-reporter": { @@ -69899,6 +69917,12 @@ "integrity": "sha512-JF2K3r6h+Hd8008spc6dAYr9Zcr1IHMuUQ8dDnBPP7k4HvdmZ3Uw9hrBjCcyxDbIU1V6KbOVHsPx0MrkTZe63w==", "requires": {} }, + "react-native-quick-sqlite": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/react-native-quick-sqlite/-/react-native-quick-sqlite-5.1.0.tgz", + "integrity": "sha512-OAwMXVqK3sGA9Ez+uKLji6hbSJVg0+vW5rAsZJgnveEpIby9RK5Fq9bhoJ9Yxe8ERmAWMKkLYp4afXNyJGYBBQ==", + "requires": {} + }, "react-native-reanimated": { "version": "3.0.0-rc.6", "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.0.0-rc.6.tgz", diff --git a/package.json b/package.json index b77dde472603..b610b67b5261 100644 --- a/package.json +++ b/package.json @@ -99,12 +99,13 @@ "react-native-image-picker": "^4.10.2", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#6b5ab5110dc3ed554f8eafbc38d7d87c17147972", "react-native-modal": "^13.0.0", - "react-native-onyx": "1.0.29", + "react-native-onyx": "1.0.32", "react-native-pdf": "^6.6.2", - "react-native-performance": "^2.0.0", + "react-native-performance": "^4.0.0", "react-native-permissions": "^3.0.1", "react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#77cc9d42c474a693755941b10ee4c2d6f50e5346", "react-native-plaid-link-sdk": "^7.2.0", + "react-native-quick-sqlite": "^5.0.3", "react-native-reanimated": "3.0.0-rc.6", "react-native-render-html": "6.3.1", "react-native-safe-area-context": "4.4.1", diff --git a/tests/ui/UnreadIndicatorsTest.js b/tests/ui/UnreadIndicatorsTest.js index cf29023c79c7..8475f8cfc999 100644 --- a/tests/ui/UnreadIndicatorsTest.js +++ b/tests/ui/UnreadIndicatorsTest.js @@ -185,7 +185,7 @@ function signInAndGetAppWithUnreadChat() { } describe('Unread Indicators', () => { - afterEach(Onyx.clear); + afterEach(() => Onyx.clear()); it('Display bold in the LHN for unread chat and new line indicator above the chat message when we navigate to it', () => { let renderedApp; diff --git a/tests/unit/NetworkTest.js b/tests/unit/NetworkTest.js index 1586e1a10c7c..0a02132af77e 100644 --- a/tests/unit/NetworkTest.js +++ b/tests/unit/NetworkTest.js @@ -36,7 +36,7 @@ beforeEach(() => { // Wait for any Log command to finish and Onyx to fully clear jest.advanceTimersByTime(CONST.NETWORK.PROCESS_REQUEST_DELAY_MS); return waitForPromisesToResolve() - .then(Onyx.clear) + .then(() => Onyx.clear()) .then(waitForPromisesToResolve); });