Skip to content
Merged
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
22 changes: 22 additions & 0 deletions tests/ui/LHNItemsPresence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
});
Loading