Skip to content

Commit 76ac18a

Browse files
Wait for UI updates to fix flaky LHN test
1 parent 7323ec5 commit 76ac18a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/ui/LHNItemsPresence.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ describe('SidebarLinksData', () => {
224224
[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report,
225225
});
226226

227-
// Then the report should appear in the sidebar because it’s pinned.
228-
expect(getOptionRows()).toHaveLength(1);
229227
await waitForBatchedUpdatesWithAct();
228+
229+
expect(getOptionRows()).toHaveLength(1);
230230

231231
const expenseReport: Report = {
232232
...createReport(false, undefined, undefined, undefined, TEST_POLICY_ID),
@@ -246,6 +246,8 @@ describe('SidebarLinksData', () => {
246246
await Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION}${transaction.transactionID}`, transaction);
247247
await Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transaction.transactionID}`, [transactionViolation]);
248248

249+
await waitForBatchedUpdatesWithAct();
250+
249251
// Then the RBR icon should be shown
250252
expect(screen.getByTestId('RBR Icon')).toBeOnTheScreen();
251253
});

0 commit comments

Comments
 (0)