fix(ui): navigate to launch step after successful test in update mode (#10223)

This commit is contained in:
Alejandro Bailo
2026-03-02 15:59:16 +01:00
committed by GitHub
parent 07dea4f402
commit c74fa131ea
2 changed files with 33 additions and 5 deletions

View File

@@ -121,6 +121,39 @@ describe("useProviderWizardController", () => {
expect(onOpenChange).not.toHaveBeenCalled(); expect(onOpenChange).not.toHaveBeenCalled();
}); });
it("moves to launch step after a successful connection test in update mode", async () => {
// Given
const onOpenChange = vi.fn();
const { result } = renderHook(() =>
useProviderWizardController({
open: true,
onOpenChange,
initialData: {
providerId: "provider-1",
providerType: "aws",
providerUid: "111111111111",
providerAlias: "production",
secretId: "secret-1",
mode: PROVIDER_WIZARD_MODE.UPDATE,
},
}),
);
await waitFor(() => {
expect(result.current.currentStep).toBe(PROVIDER_WIZARD_STEP.CREDENTIALS);
});
// When
act(() => {
result.current.setCurrentStep(PROVIDER_WIZARD_STEP.TEST);
result.current.handleTestSuccess();
});
// Then
expect(result.current.currentStep).toBe(PROVIDER_WIZARD_STEP.LAUNCH);
expect(onOpenChange).not.toHaveBeenCalled();
});
it("does not override launch footer config in the controller", () => { it("does not override launch footer config in the controller", () => {
// Given // Given
const onOpenChange = vi.fn(); const onOpenChange = vi.fn();

View File

@@ -173,11 +173,6 @@ export function useProviderWizardController({
}; };
const handleTestSuccess = () => { const handleTestSuccess = () => {
if (mode === PROVIDER_WIZARD_MODE.UPDATE) {
handleClose();
return;
}
setCurrentStep(PROVIDER_WIZARD_STEP.LAUNCH); setCurrentStep(PROVIDER_WIZARD_STEP.LAUNCH);
}; };