test connected integration-only provider visibility

This commit is contained in:
Wesley Tanner committed 2026-10-29 16:51:53 -05:00
1 parent 08d336c829
commit 74de8ac9d7
1 file changed
+18
@@ -441,6 +441,24 @@ describe('ProviderSettings', () => {
expect(screen.getByRole('button', { name: /Available Providers/ })).toHaveTextContent('0')
})
it('includes connected integration-only providers without key or OAuth methods', async () => {
vi.mocked(getProviders).mockResolvedValue({ providers: [], models: [] })
vi.mocked(oauthApi.getIntegrations).mockResolvedValue([
integrationFixture('connected-command', 'Connected Command', [commandMethod], true),
])
const user = userEvent.setup()
renderSettings()
await screen.findByText('No OAuth-capable providers available.')
expect(screen.getByRole('button', { name: /Connected/ })).toHaveTextContent('1')
await user.click(screen.getByRole('button', { name: /Connected/ }))
const connectedCard = screen.getByText('Connected Command').closest('.bg-card') as HTMLElement
expect(connectedCard).toBeInTheDocument()
expect(within(connectedCard).getByRole('button', { name: 'Remove credentials for Connected Command' })).toBeInTheDocument()
expect(within(connectedCard).queryByRole('button', { name: 'Edit API key for Connected Command' })).not.toBeInTheDocument()
})
it('keeps connected non-key providers visible without exposing API-key edit actions', async () => {
vi.mocked(getProviders).mockResolvedValue({
providers: [