feat(service-credential-tester): slice 2 — Test button + gating (shared ServiceTestPanel)

Presentational ServiceTestPanel (props-driven, no internal hooks) wired into
both CreateServiceDialog (ServicesPage.tsx) and ServiceConfigEditor
(Settings.tsx). Parent owns testResult + saveAnyway state; store-previous
pattern resets on input change (avoids setState-in-effect). Create/Save
button gated on testPassed || saveAnyway. 7 panel tests (button states,
success/failure pills, checkbox toggle). All gates: 158 vitest, build exit 0,
lint 0 errors, 362 backend pytest (regression).
This commit is contained in:
Developer
2026-07-09 22:55:55 +00:00
parent 3391fbc85d
commit f6c67bd3ff
7 changed files with 314 additions and 6 deletions
+7
View File
@@ -2,6 +2,7 @@ import { del, get, post, put } from "./shared";
import type {
ServiceInstance,
ServiceInstanceInput,
ServiceTestResult,
ServiceTypeInfo,
} from "../types";
@@ -36,3 +37,9 @@ export async function deleteServiceInstance(
): Promise<{ status: string }> {
return del<{ status: string }>(`/api/services/instances/${serviceId}`);
}
export async function testServiceInstance(
input: ServiceInstanceInput,
): Promise<ServiceTestResult> {
return post<ServiceTestResult>("/api/services/test", input);
}