mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
Wizard: type-safe onboarding install plan assertions
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user