diff --git a/package-lock.json b/package-lock.json index d7061619d382..8f671f6dc87e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -109,7 +109,7 @@ "react-native-modal": "^13.0.0", "react-native-nitro-modules": "0.26.2", "react-native-nitro-sqlite": "9.1.10", - "react-native-onyx": "2.0.127", + "react-native-onyx": "github:Expensify/react-native-onyx#0bc59bb8b764628175d65f8da39cc4076d4d26d1", "react-native-pager-view": "6.5.3", "react-native-pdf": "6.7.3", "react-native-performance": "^5.1.4", @@ -34003,8 +34003,8 @@ }, "node_modules/react-native-onyx": { "version": "2.0.127", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-2.0.127.tgz", - "integrity": "sha512-D5EeJspj6jjL10DclBbdIGVyqInSzwyzTZDejt6+SJxThk3zTbEClddkp6gXD7T9vilhIEi7+xXYkUvD/SO75w==", + "resolved": "git+ssh://git@github.com/Expensify/react-native-onyx.git#0bc59bb8b764628175d65f8da39cc4076d4d26d1", + "integrity": "sha512-GmCsqmqg6bKb9rVQCeZ9N5cadN8ZTFSdHjNR+IwJ3QJd5IR4QBEBOicceeRmAUUQcFNKv6vuL3zLU78p4n0RCA==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", diff --git a/package.json b/package.json index 02efa6e424e4..03806a7b4cd7 100644 --- a/package.json +++ b/package.json @@ -179,7 +179,7 @@ "react-native-modal": "^13.0.0", "react-native-nitro-modules": "0.26.2", "react-native-nitro-sqlite": "9.1.10", - "react-native-onyx": "2.0.127", + "react-native-onyx": "github:Expensify/react-native-onyx#0bc59bb8b764628175d65f8da39cc4076d4d26d1", "react-native-pager-view": "6.5.3", "react-native-pdf": "6.7.3", "react-native-performance": "^5.1.4", diff --git a/tests/ui/PaginationTest.tsx b/tests/ui/PaginationTest.tsx index 2fcc9f1fabf4..31b7b9317e94 100644 --- a/tests/ui/PaginationTest.tsx +++ b/tests/ui/PaginationTest.tsx @@ -95,8 +95,8 @@ async function navigateToSidebarOption(reportID: string): Promise { (NativeNavigation as NativeNavigationMock).triggerTransitionEnd(); }); // ReportScreen relies on the onLayout event to receive updates from onyx. - triggerListLayout(reportID); await waitForBatchedUpdatesWithAct(); + triggerListLayout(reportID); } function buildCreatedAction(reportActionID: string, created: string) { @@ -323,7 +323,9 @@ describe('Pagination', () => { // We now have 18 messages. 15 (MIN_INITIAL_REPORT_ACTION_COUNT) from the initial OpenReport and 3 from GetOlderActions. // GetOlderActions only returns 3 actions since it reaches id '1', which is the created action. - expect(getReportActions()).toHaveLength(18); + await waitFor(() => { + expect(getReportActions()).toHaveLength(18); + }); }); it('opens a chat and load newer messages', async () => { @@ -340,6 +342,7 @@ describe('Pagination', () => { }); // Due to https://github.com/facebook/react-native/commit/3485e9ed871886b3e7408f90d623da5c018da493 // we need to scroll too to trigger `onStartReached` which triggers other updates + await waitForBatchedUpdatesWithAct(); scrollToOffset(0); // ReportScreen relies on the onLayout event to receive updates from onyx. triggerListLayout();