From 0792bc301547bff5bd0bfb4e4b208e4a4105154c Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 18 Nov 2025 20:37:51 +0700 Subject: [PATCH] [Create Automated Test] Inbox - GBR: user mentioned in unread report --- tests/ui/LHNItemsPresence.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/ui/LHNItemsPresence.tsx b/tests/ui/LHNItemsPresence.tsx index c4b7010b9611a..ce774879a1354 100644 --- a/tests/ui/LHNItemsPresence.tsx +++ b/tests/ui/LHNItemsPresence.tsx @@ -721,5 +721,27 @@ describe('SidebarLinksData', () => { // And the GBR icon should be shown, indicating there is require action from current user. expect(screen.getByTestId('GBR Icon')).toBeOnTheScreen(); }); + + it('should display the report with GRB when the report has unread mention', async () => { + LHNTestUtils.getDefaultRenderedSidebarLinks(); + const reportWithUnreadMention: Report = { + ...createReport(false, [1, 2], 0), + lastReadTime: '2025-01-01 00:00:00', + lastMentionedTime: '2025-01-01 00:00:01', + }; + + // When Onyx state is initialized with a draft report. + await initializeState({ + [`${ONYXKEYS.COLLECTION.REPORT}${reportWithUnreadMention.reportID}`]: reportWithUnreadMention, + }); + + await waitForBatchedUpdatesWithAct(); + + // Then the sidebar should display the report with unread mention. + expect(getDisplayNames()).toHaveLength(1); + + // And the GRB icon should be shown, indicating there is unread mention. + expect(screen.getByTestId('GBR Icon')).toBeOnTheScreen(); + }); }); });