diff --git a/static/app/views/settings/organizationIntegrations/configureIntegration.spec.tsx b/static/app/views/settings/organizationIntegrations/configureIntegration.spec.tsx index de4214fa2bcd..a4a1f0e4738d 100644 --- a/static/app/views/settings/organizationIntegrations/configureIntegration.spec.tsx +++ b/static/app/views/settings/organizationIntegrations/configureIntegration.spec.tsx @@ -188,6 +188,26 @@ describe('ConfigureIntegration settings tab', () => { expect(await screen.findByRole('tab', {name: 'Settings'})).toBeInTheDocument(); expect(screen.getByRole('tab', {name: 'Code Mappings'})).toBeInTheDocument(); }); + + it('does not throw when the integration has no provider field', async () => { + // Simulates a cached/placeholder integration payload where the provider + // field is absent at runtime (e.g. from a list endpoint that omits it). + const integration = { + ...OrganizationIntegrationsFixture({configOrganization: []}), + provider: undefined, + } as unknown as OrganizationIntegration; + mockRequests(integration); + + // Should render without throwing; the component returns null when no + // matching provider is found, so the page content is empty. + renderConfigure(); + + // The loading indicator disappears once both queries resolve. + await waitFor(() => + expect(screen.queryByTestId('loading-indicator')).not.toBeInTheDocument() + ); + expect(screen.queryByRole('tab')).not.toBeInTheDocument(); + }); }); describe('ConfigureIntegration mapping removals', () => { diff --git a/static/app/views/settings/organizationIntegrations/configureIntegration.tsx b/static/app/views/settings/organizationIntegrations/configureIntegration.tsx index a84435e4cdf0..630517d1a0a9 100644 --- a/static/app/views/settings/organizationIntegrations/configureIntegration.tsx +++ b/static/app/views/settings/organizationIntegrations/configureIntegration.tsx @@ -183,7 +183,7 @@ function ConfigureIntegration() { }, }); - const provider = config.providers.find(p => p.key === integration?.provider.key); + const provider = config.providers.find(p => p.key === integration?.provider?.key); const {projects} = useProjects(); const [isVerifyingGcp, setIsVerifyingGcp] = useState(false);