diff --git a/frontend/src/v2/__tests__/ConnectorsPage.tools.test.tsx b/frontend/src/v2/__tests__/ConnectorsPage.tools.test.tsx index 2bddc2c0b..07ec520bf 100644 --- a/frontend/src/v2/__tests__/ConnectorsPage.tools.test.tsx +++ b/frontend/src/v2/__tests__/ConnectorsPage.tools.test.tsx @@ -909,6 +909,19 @@ describe('Connectors page: tools', () => { expect(meta()).toHaveTextContent('0 on · 0 available'); }); + it('TASK-752: a revoked grant whose catalogue entry is gone is not listed in Tools, only the live one is', async () => { + // No catalogue entry covers either grant, so both are orphans. Only the live one is + // still access; the revoked one must not draw a row beside it. + mockTools({ entries: [], grants: [grantLive, grantRevoked] }); + renderPage(); + + const tools = await screen.findByRole('region', { name: 'Tools' }); + await settle(); + const rows = tools.querySelectorAll('.v2-connector-row'); + expect(rows).toHaveLength(1); + expect(rows[0]).not.toHaveClass('v2-connector-row--dead'); + }); + /** * Scope §4, step 7's named test: "the page's call to start is credentialed". * diff --git a/frontend/src/v2/connectors/ConnectorsPage.tsx b/frontend/src/v2/connectors/ConnectorsPage.tsx index d637ba514..baf811dca 100644 --- a/frontend/src/v2/connectors/ConnectorsPage.tsx +++ b/frontend/src/v2/connectors/ConnectorsPage.tsx @@ -102,9 +102,12 @@ const ConnectorsPage: React.FC = () => { && (!q || connection.label.toLowerCase().includes(q)) )); // A grant whose catalogue entry is gone (retired or unreadable) has no tile, but it - // is still live access: it stays listed so it can still be seen and revoked. + // is still live access: it stays listed so it can still be seen and revoked. A dead + // one is not access any more, so it leaves the list (TASK-752); the Connectors trail + // keeps the record. const orphanGrants = grants.filter((grant) => ( !m.catalog.some((entry) => entryCovers(entry, grant)) + && !isDead(grant, m.now) && (!q || m.toolLabel(grant).toLowerCase().includes(q)) )); const toolHasDrawer = (entry: ToolCatalogEntry): boolean => grantsOf(entry).length > 0 || hiddenOf(entry).length > 0;