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
24 changes: 24 additions & 0 deletions tests/ui/LHNItemsPresence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -698,4 +698,28 @@ describe('SidebarLinksData', () => {
expect(getDisplayNames()).toHaveLength(0);
});
});

describe('Inbox - GBR', () => {
it('should display the report with GBR when the report has outstanding child task', async () => {
// Given SidebarLinks are rendered initially.
LHNTestUtils.getDefaultRenderedSidebarLinks();
const reportWithOutstandingChildTask: Report = {
...createReport(false, [1, 2], 0),
hasOutstandingChildTask: true,
};

// When Onyx state is initialized with a draft report.
await initializeState({
[`${ONYXKEYS.COLLECTION.REPORT}${reportWithOutstandingChildTask.reportID}`]: reportWithOutstandingChildTask,
});

await waitForBatchedUpdatesWithAct();

// Then the sidebar should display the outstanding report.
expect(getDisplayNames()).toHaveLength(1);

// And the GBR icon should be shown, indicating there is require action from current user.
expect(screen.getByTestId('GBR Icon')).toBeOnTheScreen();
});
});
});