Skip to content
Draft
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading