diff --git a/ui/src/pages/Inbox.test.tsx b/ui/src/pages/Inbox.test.tsx index d388f9d5d8..659f9fa53b 100644 --- a/ui/src/pages/Inbox.test.tsx +++ b/ui/src/pages/Inbox.test.tsx @@ -17,6 +17,10 @@ const routerMock = vi.hoisted(() => ({ navigate: vi.fn(), })); +const externalObjectMocks = vi.hoisted(() => ({ + summaries: new Map(), +})); + const apiMocks = vi.hoisted(() => ({ approvalsList: vi.fn(), joinRequestsList: vi.fn(), @@ -126,6 +130,14 @@ vi.mock("../hooks/useInboxBadge", () => ({ }), })); +vi.mock("../hooks/useIssueExternalObjects", () => ({ + useIssueExternalObjectSummaries: () => ({ + summaries: externalObjectMocks.summaries, + isLoading: false, + isReady: true, + }), +})); + import { FailedRunInboxRow, Inbox, @@ -255,6 +267,7 @@ function createJoinRequest( function resetInboxApiMocks() { for (const mock of Object.values(apiMocks)) mock.mockReset(); + externalObjectMocks.summaries.clear(); routerMock.location.pathname = "/"; routerMock.location.search = ""; routerMock.location.hash = ""; @@ -299,6 +312,38 @@ describe("Inbox toolbar", () => { container.remove(); }); + it("does not render external-object summaries in inbox rows", async () => { + routerMock.location.pathname = "/inbox/mine"; + const issue = createIssue({ title: "Inbox row without external object column" }); + apiMocks.issuesList.mockResolvedValue([issue]); + externalObjectMocks.summaries.set(issue.id, { + total: 1, + highestSeverity: "failed", + byStatusCategory: { failed: 1 }, + objects: [], + }); + + const queryClient = new QueryClient({ + defaultOptions: { queries: { retry: false, staleTime: 0, gcTime: 0 } }, + }); + const root = createRoot(container); + + await act(async () => { + root.render( + + + , + ); + }); + await vi.waitFor(() => { + expect(container.textContent).toContain(issue.title); + }); + + expect(container.querySelector('[aria-label^="External objects:"]')).toBeNull(); + + act(() => root.unmount()); + }); + it("shows blocked toolbar controls on the Blocked tab", async () => { routerMock.location.pathname = "/inbox/blocked"; const queryClient = new QueryClient({ diff --git a/ui/src/pages/Inbox.tsx b/ui/src/pages/Inbox.tsx index 894137a9fb..654e41ce37 100644 --- a/ui/src/pages/Inbox.tsx +++ b/ui/src/pages/Inbox.tsx @@ -2599,7 +2599,6 @@ export function Inbox() { issueLinkState={issueLinkState} treeGuides={depth} hideDivider={hasChildren && isExpanded} - externalObjectSummary={externalObjectSummaryByIssueId.get(issue.id) ?? null} selected={selected} className={ isArchiving