Wizard: type-safe onboarding install plan assertions

This commit is contained in:
Vincent Koc
2026-03-07 16:02:37 -08:00
parent 029fdd4208
commit 766d76ef9a

View File

@@ -99,6 +99,13 @@ function createRuntime(): RuntimeEnv {
};
}
function expectFirstOnboardingInstallPlanCallOmitsToken() {
const [firstArg] =
(buildGatewayInstallPlan.mock.calls.at(0) as [Record<string, unknown>] | undefined) ?? [];
expect(firstArg).toBeDefined();
expect(firstArg && "token" in firstArg).toBe(false);
}
describe("finalizeOnboardingWizard", () => {
beforeEach(() => {
runTui.mockClear();
@@ -234,7 +241,7 @@ describe("finalizeOnboardingWizard", () => {
expect(resolveGatewayInstallToken).toHaveBeenCalledTimes(1);
expect(buildGatewayInstallPlan).toHaveBeenCalledTimes(1);
expect("token" in buildGatewayInstallPlan.mock.calls[0][0]).toBe(false);
expectFirstOnboardingInstallPlanCallOmitsToken();
expect(gatewayServiceInstall).toHaveBeenCalledTimes(1);
});
});